0
는 내가하려고 할 때생성자 클래스에서 ID 값을 초기화하고 doctrine에서의 las ID 자동 증가를 얻는 방법, symfony2?
클래스 Prueba {
/**
* @var integer $id
*
* @ORM\Column(name="`id`", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
는하지만,이 필드 ID를 자동 증가와 클래스가 있습니다
public function __construct()
{
$this->entorno = new Entorno('MSU',$this->id);
}
this-> ID가 1로 초기화되지 않습니다 및 NULL입니다
원하는 항목 :
첫 번째 경우 새로운 Prueba() 또는 교리 prueba 다른
$this->id=get the last ID from table Prueba in doctrine.
$this->id = 1
내가 어떻게 할 수있는 비어?