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

@param string $lifecycleEvent The lifecycle event.
@param object $document       The Document on which the event occurred.
@param array  $arguments      the arguments to pass to the callback
Dispatches the lifecycle event of the given document to the registered lifecycle callbacks and lifecycle listeners .