It's simple. *Application\DoctratorUserBundle\Document\...*
for application-specific models and *Bundle\Doctrator\DoctratorUserBundle\Document\...* for reusable common models. And for base (autogenerated models) inside each of upper cases you could use: *Application\DoctratorUserBundle\Document\Base\...* *Bundle\Doctrator\DoctratorUserBundle\Document\Base\...* *Application\* namespace is for application bundles. It means that they are app-specific & can't be used outside of this application. *Bundle\CompanyName\* namespace is for shared (common) bundles. It means, that this bundle can be used in other applications. Your models is *always* app or bundle specific. It means, that they need to be placed inside "Application\BundleName\(Model|Document)" or "Bundle\CompanyName\BundleName\(Model|Document)" namespace. And if they (models) have parent models, that models is more likely will be current app or bundle specific to ;-) --- http://about.me/everzet/bio On Thu, Dec 16, 2010 at 10:36, Benjamin Eberlei <[email protected]> wrote: > That is what namespaces are for. > > On Thu, 16 Dec 2010 00:32:13 +0100, Pablo Díez <[email protected]> wrote: > > Hmmm, now I remember why I didn't do it then... because the class names > are > > very looong: > > > > Application\GenBundle\Document\DoctratorUserBundle\User > > Gen\DoctratorUserBundle\Document\User > > > > Do you think do it in the GenBundle is better although the class names > are > > longer? > > > > Pablo > > > > On Wed, Dec 15, 2010 at 11:24 PM, Pablo Díez <[email protected]> wrote: > > > >> Use an Application\GenBundle instead of the Gen dir? Yep, that could be > a > >> good idea to organize better the code following the S2 standards! :) > >> > >> > >> On Wed, Dec 15, 2010 at 11:02 PM, Benjamin Eberlei > >> <[email protected]>wrote: > >> > >>> Why not just generate all that stuff into an Application Bundle? That > is > >>> what Application bundles are for, the specific application at hand. > >>> > >>> On Wed, 1 Dec 2010 01:00:17 +0100 > >>> Pablo Díez <[email protected]> wrote: > >>> > >>> > Hi all! > >>> > > >>> > Usually when you want to write some class of the model (entities or > >>> > documents) or forms you do it in bundles. But what if you want do > you > >>> > do > >>> if > >>> > you to use some tool like Doctrator? > >>> > > >>> > If you want for instance customize some entity class in your > project, > >>> you > >>> > cannot do it if you don't modify the bundle. > >>> > The symfony1 way to solve this issue is to generate the final > classes > >>> > of > >>> the > >>> > model and forms in the project, then you can customize them. > >>> > > >>> > What do you think about to do something like that in Symfony2? For > >>> instance: > >>> > > >>> > src/Gen/DoctratorUserBundle/Entity/User.php > User bundle > >>> > src/Gen/DoctratorUserBundle/Entity/UserRepository.php > > UserRepository > >>> > bundle > >>> > src/Gen/DoctratorUserBundle/Entity/Base/User.php > >>> > src/Gen/DoctratorUserBundle/Entity/Base/UserRepository.php > >>> > > >>> > In the bundle: > >>> > > >>> > src/Bundle/DoctratorUserBundle/Entity/User.php > User base > >>> > src/Bundle/DoctratorUserBundle/Entity/UserRepository.php > > >>> UserRepository > >>> > base > >>> > > >>> > If we do this we will be able to have a standard way to call model > >>> classes > >>> > and to customize them. > >>> > > >>> > The standard: > >>> > Gen/DoctratorUserBundle/Entity/User > >>> > $em->getRepository('Gen/DoctratorUserBundle/Entity/User'); > >>> > > >>> > And we will be able to use another great Doctrator feature: to > extend > >>> the > >>> > entity mapping in another bundles. For instance: > >>> > > >>> > # DoctratorUserBundle > >>> > Bundle\DoctratorUserBundle\Entity\User: > >>> > columns: > >>> > id: { id: auto, type: integer } > >>> > username: { type: string, length: 100 } > >>> > > >>> > # DoctratorForumBundle > >>> > Bundle\DoctratorUserBundle\Entity\User: > >>> > columns: > >>> > signature: text > >>> > > >>> > This example extends the mapping of the DoctratorUserBundle in the > >>> > DoctratorForumBundle, but if you generate the base class in the > >>> > bundles > >>> it > >>> > would change if you change the class definition. > >>> > > >>> > Well, what do you think about do it? Do you have more ideas to call > >>> > the > >>> dir > >>> > (instead of Gen)? > >>> > > >>> > For people than don't know Doctrator: > >>> > > >>> > > http://mondongo.es/blog/9/doctrator-real-and-flexible-behaviors-for-doctrine2 > >>> > > >>> > And if you want to try this way to use model classes, you can do it > in > >>> the > >>> > DoctratorBundle: > >>> > > >>> > > https://github.com/pablodip/DoctratorBundle/commit/befddd5a62d799ce497d2761824ec38c432a0129 > >>> > > >>> > Thanks, > >>> > Pablo > >>> > > >>> > -- > >>> > *Pablo Díez | @pablodip* > >>> > MondonGO Lead Developer > >>> > http://mondongo.es > >>> > > >>> > -- > >>> > 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]<symfony-devs%[email protected]> > <symfony-devs%[email protected]<symfony-devs%[email protected]> > > > >>> > For more options, visit this group at > >>> > http://groups.google.com/group/symfony-devs?hl=en > >>> > >>> -- > >>> 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]<symfony-devs%[email protected]> > <symfony-devs%[email protected]<symfony-devs%[email protected]> > > > >>> For more options, visit this group at > >>> http://groups.google.com/group/symfony-devs?hl=en > >>> > >> > >> > >> > >> -- > >> *Pablo Díez | @pablodip* > >> MondonGO Lead Developer > >> http://mondongo.es > >> > >> > > > > > > -- > > *Pablo Díez | @pablodip* > > MondonGO Lead Developer > > http://mondongo.es > > -- > 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]<symfony-devs%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-devs?hl=en > -- 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
