/** * Execute job * * @param int $taskId * @param array $eventNames * @param array $changes * @param array $values * @param array $task * @return $this */ public function execute($taskId, array $eventNames, array $changes = array(), array $values = array(), array $task = array()) { $event = TaskEventBuilder::getInstance($this->container)->withTaskId($taskId)->withChanges($changes)->withValues($values)->withTask($task)->buildEvent(); if ($event !== null) { foreach ($eventNames as $eventName) { $this->fireEvent($eventName, $event); } } }
/** * Get iterator builder * * @access protected * @return EventIteratorBuilder */ protected function getIteratorBuilder() { $iterator = new EventIteratorBuilder(); $iterator->withBuilder(TaskEventBuilder::getInstance($this->container))->withBuilder(CommentEventBuilder::getInstance($this->container))->withBuilder(SubtaskEventBuilder::getInstance($this->container))->withBuilder(TaskFileEventBuilder::getInstance($this->container))->withBuilder(TaskLinkEventBuilder::getInstance($this->container)); return $iterator; }