public function unload($objectName)
    {
        if (empty($this->_loaded[$objectName])) {
            list($plugin, $objectName) = pluginSplit($objectName);
            $this->_throwMissingClassError($objectName, $plugin);
        }

        $object = $this->_loaded[$objectName];
        if ($this instanceof EventDispatcherInterface && $object instanceof EventListenerInterface) {
            $this->getEventManager()->off($object);
        }
        unset($this->_loaded[$objectName]);

        return $this;
    }
public function unload($objectName)
    {
        if (empty($this->_loaded[$objectName])) {
            list($plugin, $objectName) = pluginSplit($objectName);
            $this->_throwMissingClassError($objectName, $plugin);
        }

        $object = $this->_loaded[$objectName];
        if ($this instanceof EventDispatcherInterface && $object instanceof EventListenerInterface) {
            $this->getEventManager()->off($object);
        }
        unset($this->_loaded[$objectName]);

        return $this;
    }
public function unload ( $ objectName ) { if ( empty ( $ this -> _loaded [ $ objectName ] ) ) { list ( $ plugin , $ objectName ) = pluginSplit ( $ objectName ) ; $ this -> _throwMissingClassError ( $ objectName , $ plugin ) ; } $ object = $ this -> _loaded [ $ objectName ] ; if ( $ this instanceof EventDispatcherInterface && $ object instanceof EventListenerInterface ) { $ this -> getEventManager ( ) -> off ( $ object ) ; } unset ( $ this -> _loaded [ $ objectName ] ) ; return $ this ; }
Remove an object from the registry.

If this registry has an event manager, the object will be detached from any events as well.

@param string $objectName The name of the object to remove from the registry.
@return $this
Remove an object from the registry .