Php 实体';型号\ForgottenLogin';具有复合标识符,但使用ID生成器而不是手动分配(标识、序列)
当我试着这么做的时候Php 实体';型号\ForgottenLogin';具有复合标识符,但使用ID生成器而不是手动分配(标识、序列),php,Php,当我试着这么做的时候 $forgottenLoginRepo = $this->doctrine->em->getRepository('models\ForgottenLogin'); $forgottenLogin = $forgottenLoginRepo->findOneBy( array( 'passwordKey' => $key
$forgottenLoginRepo = $this->doctrine->em->getRepository('models\ForgottenLogin');
$forgottenLogin = $forgottenLoginRepo->findOneBy(
array(
'passwordKey' => $key
)
);
我得到这个错误
实体“models\ForgottenLogin”具有复合标识符,但使用
ID生成器,而不是手动分配(标识、序列)。这
不支持
我的模型是
<?php
/**
* Created by PhpStorm.
* User: Manisha.DeSilva
* Date: 06/07/2017
* Time: 13:03
*/
namespace models;
/**
* @Entity
* @Table(name="park_forgotten_login")
*
*/
class ForgottenLogin
{
/**
* @Id
* @Column(name="id", type="integer", nullable=false)
* @GeneratedValue(strategy="AUTO")
*/
private $id;
public function getId()
{
return $this->id;
}
public function setId($value)
{
$this->id = $value;
}
/**
* @Id
* @ManyToOne(targetEntity="Customer")
* @JoinColumn(name="customer_id", referencedColumnName="id")
*/
private $customer;
public function getCustomer()
{
return $this->customer;
}
public function setCustomer($value)
{
$this->customer = $value;
}
/**
* @Column(name="password_Key", type="string", nullable=false)
*/
private $passwordKey;
public function getPasswordKey()
{
return $this->passwordKey;
}
public function setPasswordKey($value)
{
$this->passwordKey = $value;
}
/**
* @Column(name="expiry", type="datetime", nullable=false)
*/
private $expiry;
public function getExpiry()
{
return $this->expiry;
}
public function setExpiry($value)
{
$this->expiry = $value;
}
private $forgottenFlag;
public function getForgottenFlag()
{
return $this->forgottenFlag;
}
public function setForgottenFlag($value)
{
$this->forgottenFlag = $value;
}
}