/** * Register an object instance for a specific object identifier * * @param string|object $identifier The identifier string or identifier object * @param ObjectInterface $object An object that implements ObjectInterface * @return ObjectManager */ public function setObject($identifier, ObjectInterface $object) { $identifier = $this->getIdentifier($identifier); $this->_registry->set($identifier, $object); return $this; }
/** * Set an identifier * * This function will reset the identifier if it has already been set. Use this very carefully as it can have * unwanted side-effects. * * @param ObjectIdentifier $identifier An ObjectIdentifier * @return ObjectManager */ public function setIdentifier(ObjectIdentifier $identifier) { $this->__registry->set($identifier); return $this; }