src/Model/Behavior/FootprintBehavior.php
public function dispatch(Event $event, $data, ArrayObject $options)
    {
        $eventName = $event->getName();
        if (empty($this->_config['events'][$eventName])) {
            return;
        }

        $fields = $this->_config['events'][$eventName];

        if ($data instanceof EntityInterface) {
            $this->_injectEntity($data, $options, $fields);

            return;
        }

        if ($data instanceof Query) {
            $this->_injectConditions($data, $options, $fields);

            return;
        }

        throw new InvalidArgumentException(sprintf(
            'Event "%s" is not supported.',
            $eventName
        ));
    }
public function dispatch(Event $event, $data, ArrayObject $options)
    {
        $eventName = $event->getName();
        if (empty($this->_config['events'][$eventName])) {
            return;
        }

        $fields = $this->_config['events'][$eventName];

        if ($data instanceof EntityInterface) {
            $this->_injectEntity($data, $options, $fields);

            return;
        }

        if ($data instanceof Query) {
            $this->_injectConditions($data, $options, $fields);

            return;
        }

        throw new InvalidArgumentException(sprintf(
            'Event "%s" is not supported.',
            $eventName
        ));
    }
public function dispatch ( Event $ event , $ data , ArrayObject $ options ) { $ eventName = $ event -> getName ( ) ; if ( empty ( $ this -> _config [ 'events' ] [ $ eventName ] ) ) { return ; } $ fields = $ this -> _config [ 'events' ] [ $ eventName ] ; if ( $ data instanceof EntityInterface ) { $ this -> _injectEntity ( $ data , $ options , $ fields ) ; return ; } if ( $ data instanceof Query ) { $ this -> _injectConditions ( $ data , $ options , $ fields ) ; return ; } throw new InvalidArgumentException ( sprintf ( 'Event "%s" is not supported.' , $ eventName ) ) ; }
Dispatch an event to the corresponding function.

Called by the event manager as per list provided by implementedEvents().

@param \Cake\Event\Event $event Event.
@param \Cake\ORM\Query|\Cake\Datasource\EntityInterface $data Query or Entity.
@param \ArrayObject $options Options.
@return void
@throws \InvalidArgumentException If method is called with an unsupported event.
Dispatch an event to the corresponding function .