[Missing value for primary key]

Par Alain Ouakbar Tabba Sardinaluile, il y a 7 ans


Bonjour,

Voila je rencontre un petit problème avec mon code.

J'ai 2 entités avec une relation ManytoOne : EgwPrestation <-- EgwAddressbook

Le problème est apparu à partir de versions supérieures à 2.1 : quand je manipule les données (repository de EgwPrestation), j'ai le message suivant :

****Uncaught PHP Exception Doctrine\Common\Proxy\Exception\OutOfBoundsException: "Missing value for primary key addressbookId on Lea\PrestaBundle\Entity\EgwAddressbook" at /htdocs/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php line 40

<?php namespace Lea\PrestaBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; /** * Lea\PrestaBundle\Entity\EgwAddressbook * * @ORM\Table(name="egw_addressbook") * @ORM\Entity(repositoryClass="Lea\PrestaBundle\Entity\EgwAddressbookRepository") */ class EgwAddressbook { /** * @var integer $addressbookId * * @ORM\Column(name="addressbook_id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $addressbookId; /** * @var string $contactId * * @ORM\Column(name="contact_id", type="integer", nullable=true) */ private $contactId; ETC....ETC...

Voici mon entité EgwPrestation :

/** * @ORM\ManyToOne(targetEntity="EgwAddressbook", inversedBy="prestationsP") * @ORM\JoinColumn(name="id_contact_prescripteur", referencedColumnName="contact_id") */ private $contactPr;

Je cherche depuis plusieurs jours déjà, sur plusieurs sites.

Merci pour votre aide.

Aucune réponse