Doctrine\ODM\PHPCR\Mapping\ClassMetadata::invokeLifecycleCallbacks PHP Method

invokeLifecycleCallbacks() public method

Dispatches the lifecycle event of the given document to the registered lifecycle callbacks and lifecycle listeners.
public invokeLifecycleCallbacks ( string $lifecycleEvent, object $document, array $arguments = null )
$lifecycleEvent string The lifecycle event.
$document object The Document on which the event occurred.
$arguments array the arguments to pass to the callback
    public function invokeLifecycleCallbacks($lifecycleEvent, $document, array $arguments = null)
    {
        foreach ($this->lifecycleCallbacks[$lifecycleEvent] as $callback) {
            if ($arguments !== null) {
                call_user_func_array(array($document, $callback), $arguments);
            } else {
                $document->{$callback}();
            }
        }
    }
ClassMetadata