KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I got problems with persisting many to many self referencing relations. I receive error: The class 'Doctrine\ORM\Persisters\ManyToManyPersister' was not found in the chain configured namespaces This happens when I remove all children form item saved with them. Leaving at least one don't make error happen. Also if I initially save entity with no children everything works fine. /** * West\AlbumBundle\Entity\Album * * @ORM\Table(name="albums") * @ORM\Entity(repositoryClass="West\AlbumBundle\Entity\AlbumRepository") * @ORM\HasLifecycleCallbacks */ class Album extends Entity implements CrudEntity { /** * @ORM\ManyToMany(targetEntity="Album") * @ORM\JoinTable(name="albums_relations", * joinColumns={@ORM\JoinColumn(name="album_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="related_album_id", referencedColumnName="id")} * ) * @var ArrayCollection */ protected $related_albums; } If you're testing with Symfony2 forms remember to set "by_reference" => false
Tags (comma-separated)
Save Edits
Cancel