I want to add an item like this just to the src/Acme/AdminBundle/Entity/Artist.orm.yml:
email:
type: string
column: email_address
length: 150
but I'm forced to do the same in the file Acme/AdminBundle/Entity/Artist
/**
* @var string $email
*/
private $email;
If I don't do it, when I update the schema it shows an error:
php app/console doctrine:schema:update --force
[Doctrine\ORM\Mapping\MappingException]
An error occurred in Acme\AdminBundle\Entity\Artist
[ReflectionException]
Property email does not exist
I generated the Bundle with the yml option at the beginning.
First, generate the entity class file
php app/console doctrine:generate:entities [Your]/[Bundle]/Entity/Artist --path="src/" --no-backup
The "--path" param must be given if there is a new entity to be generated.
Then, update your schema:
php app/console doctrine:schema:update --force
I had the same problem and I managed to solve it.
doctrine:generate:entity generates the .php entity file at "Entity" but it also generates a orm file at "Resources/config/doctrine" which can create conflicts if you modify the .php entity file.
I just deleted the orm files and it works as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With