public function getChild($name) { foreach ($this->childProperties as $child) { if ($child->getName() === $name) { return $child; } } throw new NoSuchPropertyException(); }