/** * Get an instance of a class based on a class identifier only creating it if it doesn't exist yet. * * @param mixed $identifier An KObjectIdentifier, identifier string or object implementing KObjectInterface * @param array $config An optional associative array of configuration settings. * @return KObjectInterface Return object on success, throws exception on failure * @throws RuntimeException if the object manager has not been defined. * @see KObjectInterface */ public final function getObject($identifier, array $config = array()) { if (!isset($this->__object_manager)) { throw new RuntimeException("Failed to call " . get_class($this) . "::getObject(). No object_manager object defined."); } return $this->__object_manager->getObject($identifier, $config); }
/** * Get an instance of an object identifier * * @param KObjectIdentifier|string $identifier An ObjectIdentifier or valid identifier string * @param array $config An optional associative array of configuration settings. * @return KObjectInterface Return object on success, throws exception on failure. */ public final function getObject($identifier, array $config = array()) { $result = $this->__object_manager->getObject($identifier, $config); return $result; }