Hello,

I am trying to clearly understand how works the doctrine2 integration inside 
Symfony2. I come up with different issues. Maybe I am not doing things well ...

As a developer I want to create expandable bundle, which means at the doctrine2 
level : create entities inside my bundle which are expandable at the 
application level.

So far, the only workable solution I found is to define mapped-superclass 
inside the bundle and to generate the concrete child class inside the 
Application.

which means : Application\BlogBundle\Entity\Post extends 
Bundle\BlogBundle\Entity\BasePost

The BasePost is declared as abstract and the id definition is set in the Post 
class. 

So when I want to create an doctrine query I can use these notations :
 -  'Application\BlogBundle\Entity\Post' 
 - 'BlogBundle:Post'

When I need to create an object I can do : 
 - 'new Application\BlogBundle\Entity\Post' 
 - '$em->getClassMetadata('UrlShortenerBundle:Url')->name'

Do you have a better solution for now ?

Thomas

-- 
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 developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to