must once again be useful. :/
I have an Entity "User" with a "USER_EMP" field that refers to an entity
"Firm".
So have a User Group for each of Firm.
I tried the following:
*class Firm {*
/**
* @var integer
*
* @ORM\Column(name="EMP_ID", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $empId;
/**
* @ORM\OneToMany(targetEntity="Rangos\Entity\User")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="EMP_ID", referencedColumnName="USER_EMP")
* })
*/
private $employee;
}
*class User {*
/**
* @var integer $userId
*
* @ORM\Column(name="USER_ID", type="integer", nullable=false)
* @ORM\Id
*/
private $userId;
/**
* @ORM\ManyToOne(targetEntity="Rangos\Entity\Firm" ,
inversedBy="employee"))
* @ORM\Id
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="USER_EMP", referencedColumnName="EMP_ID")
* })
*/
private $userEmp;
}
*I get the following exception:*
MappingException: OneToMany mapping on field 'employee' requires the
'mappedBy' attribute.
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.