[Solved] Object as attribute, get parent class
No implicit methods. You must notify the instance when that happens. See this example: class Beer{ private $ingredients = []; public function addIngredient(Ingredient $ing){ $this->ingredients[] = $ing; $ing->setOwner($this); } } class Ingredient{ private $owner; public function getOwner(){ return $this->owner; } public function setOwner($owner){ $this->owner = $owner; } public function hasOwner() : bool{ return isset($this->owner); } … Read more