h4cc / AliceFixturesBundle

A Symfony2 bundle for using Alice and Faker with data fixtures. Abled to use Doctrine ORM as well as Doctrine MongoDB ODM.
MIT License
75 stars 25 forks source link

Value objects should not be persisted #11

Closed alesblaznik closed 10 years ago

alesblaznik commented 10 years ago

When in .yml file I define: Nelmio\Data\Geopoint (local): loader tries to persist this entity so I get Doctrine mapping error.

h4cc commented 10 years ago

Might you provide some more code and the error message? Maybe using a gist.

alesblaznik commented 10 years ago

Of course. This is the sample of yaml file: https://gist.github.com/alesblaznik/8757211 . Thrown exception: Doctrine\Common\Persistence\Mapping\MappingException

The problem is that the Class itself is being persisted which is wrong because it is flagged as being "local".

I suspect that using $this->persist($references, $set->getDoDrop()); in Fixtures/FIxtureManger.php is wrong, because this references are not filtered by local.

h4cc commented 10 years ago

I think i found the cause of this bug. Will try to find a solution for this.

h4cc commented 10 years ago

@alesblaznik Could you please try this branch? https://github.com/h4cc/AliceFixturesBundle/tree/dev-issue11

alesblaznik commented 10 years ago

@h4cc That works perfectly. I also tried this branch on larger set and it all works.Thanks.