doctrine-orm
Using EntityManager inside Doctrine 2.0 entities
It is not a good idea to allow an entity object to rely on the entity manager. It ties the entity to the persistence layer, which was a problem Doctrine 2 was specifically trying to solve. The biggest hassle in relying on the entity manager is that it makes your model hard to test in … Read more
Doctrine2 conversion error
You probably changed a field from type string to type array in your entity but already have data the database. It’s failing at trying to convert an empty string from the database to an array. If it’s a development database, simply delete it and create it again, or just delete the offending rows. Or you … Read more
Unique Constraints in Doctrine 2, Symfony 2
In the Table annotation, you can also set an index for multiple columns. /** * @ORM\Entity * @ORM\Table(name=”ecommerce_products”,uniqueConstraints={ * @ORM\UniqueConstraint(name=”search_idx”, columns={“name”, “email”})}) */ or with YAML format: Namespace\Entity\EntityName: type: entity table: ecommerce_products uniqueConstraints: uniqueConstraint: columns: [name, email]
How to get Doctrine ORM instance in Symfony2 console application? [duplicate]
If you extend from ContainerAwareCommand you should be able to get your service $this->getContainer()->get(‘doctrine’); Here is similar question