alice: 3.x — as no identity/no id values set. It cannot be added to the identity map.
I have two entities.
user (entity 1)
- id (primary key)
- name
detail (entity 2)
- user (primary key, which is from user entity)
- address
When running fixtures with
detail_{1..10}:
user: "@user_<current()>"
I get the following error
[Doctrine\ORM\ORMInvalidArgumentException]
The given entity of type ‘AppBundle\Entity\Detail’ (AppBundle\Entity\Detail@0000000007f1464d000000006748ef3
e) has no identity/no id values set. It cannot be added to the identity map.
Please note that this was working fine on 2.x
Stackoverflow links https://stackoverflow.com/a/30404503/75799
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (13 by maintainers)
Commits related to this issue
- custom persist added https://github.com/nelmio/alice/issues/777 — committed to iBasit/alice-problem by iBasit 7 years ago
- persist error https://github.com/nelmio/alice/issues/777 — committed to iBasit/alice-problem by iBasit 7 years ago
Sorry I forgot to post my message yesterday, see https://github.com/theofidry/alice-problem/commit/14bf2e0c2b8379ee0950a4a6aba35044a9681838.
Arguably there is some design issues:
Can’t do much atm, but PRs are welcome 😃
I have reproduced the problem at https://github.com/iBasit/alice-problem.git
Getting up and running is easy as 123.
composer install
bin/console database:create:database
bin/console doctrine:schema:update --force
and then just test with
bin/console hautelook:fixtures:load
I hope you can help on this. Thank you