AppserverIo\Appserver\PersistenceContainer\BeanManager::destroyBeanInstance PHP Метод

destroyBeanInstance() публичный Метод

Invokes the bean method with a pre-destroy callback.
public destroyBeanInstance ( object $instance ) : void
$instance object The instance to invoke the method
Результат void
    public function destroyBeanInstance($instance)
    {
        // load the object manager
        $objectManager = $this->getApplication()->search(ObjectManagerInterface::IDENTIFIER);
        // load the bean descriptor
        $descriptor = $objectManager->getObjectDescriptors()->get(get_class($instance));
        // invoke the pre-destroy callbacks if we've a session bean
        if ($descriptor instanceof SessionBeanDescriptorInterface) {
            foreach ($descriptor->getPreDestroyCallbacks() as $preDestroyCallback) {
                $instance->{$preDestroyCallback}();
            }
        }
    }