What are the possible causes of an EntityNotFoundException when accessing proxy class properties in doctrine 2? In any case, the structure of my entities is as follows:
/**
* @ORM\Table(name="comments")
*
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="comment_type", type="smallint")
* @ORM\DiscriminatorMap({
* 1 = "VisitorComment",
* 2 = "MemberComment"
* })
*/
class Comment
{
//with common properties of its subclasses
}
Subclasses:
class MemberComment extends Comment
{
private $author;
public function setAuthor($author)
{
$this->author = $author;
}
public function getAuthor()
{
return $this->author;
}
}
class VisitorComment extends Comment
{
private $author;
public function setAuthor($author)
{
$this->author = $author;
}
public function getAuthor()
{
return $this->author;
}
}
An exception occurs when I call $ comment-> getAuthor () → getFirstName () <assuming that the author, which is a Member or Visitor object, has the firstName> property. GetAuthor () in this case returns the proxy class of either VisitorProxy or MemberProxy.
Please help me. I am still not familiar with the doctrine.
source
share