Phergie_Event_Handler::getEventsOfType PHP Méthode

getEventsOfType() public méthode

Returns a list of events of a specified type.
public getEventsOfType ( string $type ) : array
$type string Event type from Phergie_Event_Request::TYPE_* constants
Résultat array Array containing event instances of the specified type or an empty array if no such events were found
    public function getEventsOfType($type)
    {
        $events = array();
        foreach ($this->events as $event) {
            if ($event->getType() == $type) {
                $events[] = $event;
            }
        }
        return $events;
    }

Usage Example

Exemple #1
0
 /**
  * Gets the events added to the handler by the plugin
  * @param string $type
  * @return array | null
  */
 public function getResponseEvents($type = null)
 {
     if (is_string($type) && strlen($type) > 0) {
         return $this->handler->getEventsOfType($type);
     }
     return $this->handler->getEvents();
 }
All Usage Examples Of Phergie_Event_Handler::getEventsOfType