我有Peticion
实体但缺少某些东西,因为出现以下错误:
No identifier/primary key specified for Entity (...) Every Entity must have and identifier/primary key
这是实体代码:
<?php
namespace Project\UsuarioBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Peticion
*
* @ORM\Table(name="peticion")
* @ORM\Entity
*/
class Peticion
{
/**
*
* @ORM\Id
* @ORM\ManyToMany(targetEntity="Project\UsuarioBundle\Entity\Usuario", inversedBy="usuNick2")
* @ORM\JoinTable(name="USUARIO",
* joinColumns={@ORM\JoinColumn(name="USU_NICK_1", referencedColumnName="USU_NICK")},
* inverseJoinColumns={@ORM\JoinColumn(name="USU_NICK_2", referencedColumnName="USU_NICK")}
* )
*/
private $usuNick1;
/**
*
* @ORM\Id
* @ORM\ManyToMany(targetEntity="Project\UsuarioBundle\Entity\Usuario", mappedBy="usuNick1"))
*/
private $usuNick2;
/**
* @var \DateTime
*
* @ORM\Column(name="PET_FECHA", type="date", nullable=false)
*/
private $fecha;