Вопрос по – Doctrine2 - получить идентификатор объекта до сброса

11

Error: User Rate Limit Exceeded

$entity = new PointData();
$form   = $this->createForm(new PointDataType(), $entity);

Error: User Rate Limit Exceeded$entity->getId()Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

$em->persist($entity);
$em->flush();

Error: User Rate Limit Exceeded$em = $this->getDoctrine()->getEntityManager();)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded Xavi
Error: User Rate Limit Exceededidentifier generation strategiesError: User Rate Limit Exceeded Crozin

Ваш Ответ

3   ответа
6

<?php

use Doctrine\ORM\Mapping as ORM;

/** 
 * @ORM\Entity 
 * @ORM\HasLifecycleCallbacks 
 */
class PointData
{
    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
     private $id;

     ...

     /** 
      * @ORM\PostPersist 
      */
     public function onPostPersist()
     {
         // Put some simple logic here that required the auto-generated Id.
     }

     ...

}
0

23

Error: User Rate Limit Exceeded Xavi
Error: User Rate Limit Exceededen.wikipedia.org/wiki/Universally_unique_identifierError: User Rate Limit Exceeded
Error: User Rate Limit Exceededgithub.com/ramsey/uuidError: User Rate Limit Exceededgithub.com/ramsey/uuid-doctrineError: User Rate Limit Exceeded

Похожие вопросы