Doctrine: Set primary Key
Try with ORM\GeneratedValue
/** * @var string * * @ORM\Column(name="token", type="string", length=45, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */private $token;
Maybe this could help Doctrine2 Primary Key.
And if you did not create your table using the doctrine
command check if $token
set to Primary Key
in your database.