I am unable to get my entities to work with a one to one relationship.
/**
* Beacon\Entities\User
*/
class User {
/**
* @var string
*/
private $firstName;
/**
* @var string
*/
private $lastName;
/**
* @var string
*/
private $userName;
/**
* @var string
*/
private $password;
/**
* @var string
*/
private $email;
/**
* @var string
*/
private $mobile;
/**
* @var string
*/
private $address1;
/**
* @var string
*/
private $address2;
/**
* @var \DateTime
*/
private $dateCreated;
/**
* @var integer
*/
private $id;
class UserAccount {
/**
* @var integer
*/
private $ispaid;
/**
* @var \Beacon\Entities\User
*/
private $id;
<? xml version = "1.0"
encoding = "utf-8" ?>
< doctrine - mapping xmlns = "http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemaLocation = "http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" >
< entity name = "Beacon\Entities\UserAccount"
table = "user_account" >
< id name = "id"
association - key = "true" / >
< field name = "ispaid"
type = "integer"
column = "ispaid"
nullable = "true" >
< options >
< option name = "unsigned" / >
< /options>
</field >
< one - to - one field = "id"
target - entity = "Beacon\Entities\User"
fetch = "LAZY" >
< join - columns >
< join - column name = "id"
referenced - column - name = "id" / >
< /join-columns>
</one - to - one >
< /entity>
</doctrine - mapping >
This is the error I get
Type: Doctrine\ORM\ORMInvalidArgumentException
Message: The given entity of type 'Beacon\Entities\UserAccount' (Beacon\Entities\UserAccount@0000000050a7b33800000000160edb7c) has no identity/no id values set. It cannot be added to the identity map.
Where am i going wrong
</div>