我给出了以下错误:
Catchable Fatal Error: Argument 1 passed to BackendBundle\Entity\Notification::sendSystemMessage()
must be an instance of BackendBundle\Entity\BackendBundle\Entity\User, instance of
Proxies\__CG__\BackendBundle\Entity\User given
我在 Notification.php 类中的方法是:
/**
* Send System message, to be used after creating a blank one
*
* @param \BackendBundle\Entity\User $reciever
*
* @param string $message
*
* @return Notification
*/
public function sendSystemMessage(BackendBundle\Entity\User $reciever, $message)
{
$this->setReciever($reciever);
$this->setMessage($message);
$this->setTimestamp(new \DateTime());
$this->setReaded(false);
$this->setSystemMessage(true);
return $this;
}
当我使用 setReciever 之类的 setter 和 getter 时,它工作得很好,但是当我尝试调用多个参数时,我得到了这个错误,我犯了一个错误,或者实体类中不能有多个参数方法?