Jackalope\Observation\Event::setType PHP Method

setType() public method

public setType ( string $type )
$type string
    public function setType($type)
    {
        $this->type = $type;
    }

Usage Example

 /**
  * Assert a filter only match the given event types
  *
  * @param EventFilter $filter
  * @param array       $matchedTypes An array of matched event types
  */
 protected function assertFilterMatch(EventFilter $filter, $matchedTypes)
 {
     foreach ($this->allEventTypes as $type) {
         $event = new Event($this->factory, $this->getNodeTypeManager());
         $event->setType($type);
         $mustAccept = in_array($type, $matchedTypes);
         $message = sprintf("The filter with accepted types '%s' did not match the event type '%s'", $this->eventFilter->getEventTypes(), $type);
         $this->assertEquals($mustAccept, $filter->match($event), $message);
     }
 }
All Usage Examples Of Jackalope\Observation\Event::setType