I just wanted to be sure that this is really the way to do it and not
some kind of workaround.
Thanks for the pointer.

Now I run into trouble with the ORM:
http://docs.symfony-reloaded.org/guides/doctrine/orm/overview.html

I saved the User class in the Entity directory but when I issue the
doctrine:schema:create action symfony only dumps the contents of the
file in the shell and then says "No Metadata Classes to process." as
if it doesn't see the @Entity, @Column, etc. metadata in the file:

[den...@nexusd dam]$ php hello/console doctrine:schema:create
// Application/HelloBundle/Entity/User.php

namespace Application\HelloBundle\Entity;

/**
 * @Entity
 */
class User
{
...
}

No Metadata Classes to process.
[den...@nexusd dam]$

On Sep 18, 8:20 pm, Richard D Shank <deve...@zestic.com> wrote:
> The documentation is a little out of date. Its part of the fun of
> shooting at a moving target :)
>
> Bascially, by looking in the ~ProjectContainer.php, in the cache folder,
> you can find the method names of the services that are available.  They
> can be called from any container.
>
> Since the controller implements the ContainerAwareInterface, it has
> direct access to the container.**  Because of this, you could also do
> $conn = $this['doctrine.dbal.default_connection']
> from the controller.  This looks more like what you see in the
> documentation.
>
> Spend some time with the ~ProjectContainer.php file.  Look in the
> getDefaultParameters() method to see all of the wonderful things that
> are available in the container.
>
> Richard
>
> On 09/18/2010 11:10 AM, Dennis Jacobfeuerborn wrote:
>
> > I'm not sure I understand what you are trying to say. I basically try
> > to get this example going:
> >http://docs.symfony-reloaded.org/guides/doctrine/dbal/overview.html
>
> > That doesn't mention "getDoctrine_Dbal_DefaultConnectionService()"
> > anywhere.
>
> > On Sep 18, 7:57 pm, spike3111<gilles.gauthie...@gmail.com>  wrote:
>
> >> You have to look in the cache, the methods generated there. Surely
> >> this is getDoctrine_Dbal_DefaultConnectionService() you need.
>
> >> On 18 sep, 19:37, Dennis Jacobfeuerborn<djacobfeuerb...@gmail.com>
> >> wrote:
>
> >>> Hi,
> >>> I'm playing around in the sandbox to get a feel for Symfony2 (I
> >>> already have Symfony1 experience). After trying to get the Doctrine
> >>> stuff going it ran into trouble. After enabling the doctrine dbal and
> >>> orm in the config file I inserted the following line from the docs in
> >>> my code:
>
> >>> $conn = $this->container->getService('database_connection');
>
> >>> This results in an exception:
> >>> Call to undefined method helloDevDebugProjectContainer::getService
>
> >>> The code that creates the exception is this:
> >>> public function __call($method, $arguments)
> >>> {
> >>>   if (!preg_match('/^get(.+)Service$/', $method, $match)) {
> >>>               throw new \BadMethodCallException(sprintf('Call to
> >>> undefined method %s::%s.', get_class($this), $method));
>
> >>> }
>
> >>> What is peculiar here is that the regular expression can never match
> >>> the getService() call. Is this an error in the documentation or should
> >>> the regexp rather be "get(.*)Service" to allow for the call in the
> >>> docs to be valid?
>
> >>> Regards,
> >>>    Dennis

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to