public function __set($key, $val) { // If the item being set is a composite view, we'll set // its parent object if ($val instanceof CompositeView) { $val->setParent($this); } parent::__set($key, $val); }