This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Doctrine: Can't sync when using PHP annotations

Discuss Symfony 2 bundles here

Doctrine: Can't sync when using PHP annotations

by xspecial » Tue Sep 23, 2014 4:03 pm

Hi there,

i'm using Symfony2.5 with Doctrine for the first time and i'm following the Symfony2 Book (Doctrine chapter) to understand how to syncronize the project with a Relational DB.

i've noticed that when i create a new entity with:

Code: Select all
php app/console doctrine:generate:entity


and i choose PHP Annotations, the command:

Code: Select all
php app/console doctrine:schema:update --force


says that all is already up to date.

Instead:

Code: Select all
php app/console doctrine:schema:create


says:

No Metadata Classes to process.

Otherwise, if I use XML or YML, all works perfectly.

But i've also noticed that when i edit the XML and YML resources/config/doctrine files, the command:

Code: Select all
php app/console doctrine:generate:entities Acme


recognize the modifications on just the XML file and not in the YML nor PHPAnnotations files:

Generating entities for namespace "Acme"
> backing up TestXML.php to TestXML.php~
> generating Acme\StoreBundle\Entity\TestXML


Am i doing something wrong?

I can't understand why only XML entity files are fully working, YML can't updates and PHP Annotations aren't even taken into account

Thanks to all
xspecial
Junior Member
 
Posts: 1
Joined: Tue Sep 23, 2014 3:24 pm

Re: Doctrine: Can't sync when using PHP annotations

by cbcaio » Sat Oct 04, 2014 3:46 pm

Having the same problem, if you found out the solution can you share it with me?

Thanks :)
cbcaio
Junior Member
 
Posts: 5
Joined: Fri Oct 03, 2014 4:01 pm