_cached) return $this->_cachedObject; $className = $this->getOwner()->object_model; if ($className == "") { $this->_cached = true; return null; } $object = $className::model()->findByPk($this->getOwner()->object_id); if (count($this->mustBeInstanceOf) == 0 || $object == null) { $this->_cached = true; $this->_cachedObject = $object; return $object; } // Validates object foreach ($this->mustBeInstanceOf as $instance) { if ($object instanceof $instance || $object->asa($instance) !== null) { $this->_cached = true; $this->_cachedObject = $object; return $object; } } throw new CHttpException(500, 'Underlying object of invalid type! (' . $className . ')'); } } ?>