Closed nursultanturdaliev closed 8 years ago
See similar issues, like https://github.com/doctrine/data-fixtures/issues/230, https://github.com/doctrine/data-fixtures/issues/231
Closing as duplicate.
@Ocramius It looks like not a duplicate issue. #230 , #231 don't deal with a circular reference error as shown below:
[Doctrine\Common\DataFixtures\Exception\CircularReferenceException] Graph contains cyclic dependency. An example of this problem would be the following: Class C has class B as its dependency. Then, class B has class A has its dependency. Finally, class A h as class C as its dependency.
I am getting this error because of self-referencing properties like:
/**
* @Gedmo\TreeParent
* @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
* @ORM\JoinColumn(referencedColumnName="id", onDelete="CASCADE")
*/
private $parent;
/**
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
* @ORM\OrderBy({"lft" = "ASC"})
*/
private $children;
Are you already on 1.2.1
? We fixed that in https://github.com/doctrine/data-fixtures/pull/229, as far as I know
@Ocramius thanks 👍 . My version was 1.2.0. Just updated and it's working fine.
I have the same problem, but I'm using the 1.2.1
. How can I fix that?
Here is my Entity: Gist
PS: I'm using alice bundle to load my fixture.
Also ran into this problem today with a self-referencing ManyToOne property. Also using 1.2.1 and whilst we normally use Alice, too, the issue also present when running the standard doctrine:fixtures:load.
Guys I having an issue while trying to load fixtures for an entity with a tree behavior. You can see my entity on gist. Did anyone have issue like this and how did you solve it?