src/CI_Base_Model.php
public function trigger($event, $data = FALSE, $last = TRUE)
    {
        if (isset($this->event_listeners[$event]) && is_array($this->event_listeners[$event])) {
            $data = $this->_trigger_event($this->event_listeners[$event], $data, $last);
        }elseif (isset($this->$event) && is_array($this->$event)){
            $data = $this->_trigger_event($this->$event, $data, $last);
        }

        return $data;
    }
public function trigger($event, $data = FALSE, $last = TRUE)
    {
        if (isset($this->event_listeners[$event]) && is_array($this->event_listeners[$event])) {
            $data = $this->_trigger_event($this->event_listeners[$event], $data, $last);
        }elseif (isset($this->$event) && is_array($this->$event)){
            $data = $this->_trigger_event($this->$event, $data, $last);
        }

        return $data;
    }
Trigger an event and call its observers. Pass through the event name
(which looks for an instance variable $this->event_listeners[event_name] or $this->event_name), an array of
parameters to pass through and an optional 'last in iteration' boolean

@param $event
@param bool|array|void|int $data
@param bool $last
@return bool|mixed