Home Documentation Download Pricing Buy Now

[Tip] How to configure namespace for Doctrine2 project

0 votes

Question received by email.

ORM Designer fully supports namespaces in Doctrine2 projects. Each module in ORM Designer can have its own namespace. This namespace is exported to each entity, association and inheritance leading to this entity.

If you want to configure namespace, choose Module and edit namespace property inside the ORM property editor:

Doctrine2 namespace configuration in ORM Designer

Hope this tips will help you enjoy ORM Designer. If you have any question about this topic, feel free to discus it bellow!

asked Jul 18, 2013 in How To & Manuals by ludek.vodicka Skipper developer (140,530 points)

1 Answer

0 votes
 
Best answer

Nota bene: For the Inheritance to work correctly with annotations export format, you need to prefix the namespace with a backslash. Otherwise the generated class definition will read

namespace Acme\DemoBundle\Entity;
class Child extends Acme\DemoBundle\Entity\Parent
{

This will cause the Parent class to be invalid (FQCN \Acme\DemoBundle\Entity\Acme\DemoBundle\Entity\Parent). With an extra backslash in the front, the namespace definition is left intact while the extends statement is corrected.

answered Mar 17, 2014 by jwagner (3,630 points)
selected Jul 30, 2014 by Martin Freki Stradej

Thanks for info. We will fix this in the upcomming release.

...