Answer the question
In order to leave comments, you need to log in
How to make primary key from two columns in Symfony 4?
Throws an error:
No identifier/primary key specified for Entity "App\Metrag\AppBundle\Entity\AgentRealty". Every Entity must have an identifier/primary key.
/**
* AgentRealty
*
* @ORM\Entity
*
*/
class AgentRealty
{
/**
* @ORM\OneToOne(targetEntity="App\Metrag\AppBundle\Entity\Realty")
* @ORM\JoinColumn(name="realty_id", referencedColumnName="id" )
*/
private $realty;
/**
* @ORM\OneToOne(targetEntity="App\Metrag\AppBundle\Entity\Agent")
* @ORM\JoinColumn(name="agent_id", referencedColumnName="id" )
*/
private $agent;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question