Repository navigation
Open
Description
Hi, when trying to use DoctrineWriter to insert values for my associated one-to-one (unidirectional) entity I receive the following error:
The identifier id is missing for a query of MyVendor\ServicesBundle\Entity\MyAssociatedEntity
It is properly important to mention that the record of the parent entity already exists when running this script. At the time of execution there is a null key value for the associated entity stored in the parent entity.
These entities have been tested with CRUD functionality both with and without NULL values and they seem to behave fine except in combination with DoctrineWriter.
My Doctrine Parent Entity:
/**
* @ORM\OneToOne(targetEntity="MyAssociatedEntity", cascade={"persist", "remove"})
* @ORM\JoinColumn(name="myassociatedentity_id", referencedColumnName="id", nullable=true)
*/
private $myAssociatedEntity;
Here is some stack trace:
2. at ORMException ::missingIdentifierField ('MyVendor\\ServicesBundle\\Entity\\MyAssociatedEntity', 'id')
in vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php at line 481 +
3. at EntityManager ->getReference ('MyVendor\\ServicesBundle\\Entity\\MyAssociatedEntity', array('languages' => 'Dutch,Papiamento'))
in vendor\portphp\doctrine\src\DoctrineWriter.php at line 266 +
4. at DoctrineWriter ->loadAssociationObjectsToObject (array('isoAlpha2' => 'AW', 'isoAlpha3' => 'ABW', 'capital' => 'Oranjestad', 'continent' => 'Americas', 'region' => 'Caribbean', 'myAssociatedEntity' => array('languages' => 'Dutch,Papiamento'), 'currencyCode' => 'AWG'), object(Country))
in vendor\portphp\doctrine\src\DoctrineWriter.php at line 180 +
5. at DoctrineWriter ->writeItem (array('isoAlpha2' => 'AW', 'isoAlpha3' => 'ABW', 'capital' => 'Oranjestad', 'continent' => 'Americas', 'region' => 'Caribbean', 'myAssociatedEntity' => array('languages' => 'Dutch,Papiamento'), 'currencyCode' => 'AWG'))
in src\MyVendor\AdminBundle\Service\Importer.php at line 163 +
Is there a workaround for this issue?
Metadata
Metadata
Assignees
Labels
No labels
Activity