We have some Entity classes that implement custom getter functions which return entities as well, as those are not properties there seems to be no way to exclude them. As soon as the ItemNormalizer uses the ResourceClassResolver to resolve the class for this property it will crash. What is the best way to approach this?
An example would be an Entity like this:
//...
class Category{
//...
/**
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent", cascade={"remove"})
* @Groups({"read","write"})
*/
protected $children;
//Getters, setters etc. here - works fine
//..
//Custom method which will fail
public function getLastLeaf(){
//Skipping implementation
return $mySomeOtherEntityRelatedToThis;
}
}
We have some Entity classes that implement custom getter functions which return entities as well, as those are not properties there seems to be no way to exclude them. As soon as the ItemNormalizer uses the ResourceClassResolver to resolve the class for this property it will crash. What is the best way to approach this?
An example would be an Entity like this: