コード例 #1
0
 /**
  * @param string $type
  * @param AbstractRevision $object
  * @param array $metadata
  * @param array $params
  * @throws InvalidDataException
  */
 protected function notifyPostChange($type, $object, $metadata, array $params = array())
 {
     if (!isset($metadata['workflow'], $metadata['topic-title'])) {
         throw new InvalidDataException('Invalid metadata for revision ' . $object->getRevisionId()->getAlphadecimal(), 'missing-metadata');
     }
     $workflow = $metadata['workflow'];
     if (!$workflow instanceof Workflow) {
         throw new InvalidDataException('Workflow metadata is not a Workflow', 'missing-metadata');
     }
     $this->notificationController->notifyPostChange($type, $params + array('revision' => $object, 'title' => $workflow->getOwnerTitle(), 'topic-workflow' => $workflow, 'topic-title' => $metadata['topic-title']));
 }
コード例 #2
0
 public function afterTopicImported(TopicImportState $state, IImportTopic $topic)
 {
     if (!$topic instanceof LqtImportTopic) {
         return;
     }
     if ($this->postsImported === false) {
         // nothing was imported in this topic
         return;
     }
     $this->postsImported = false;
     $this->controller->notifyPostChange('flow-post-reply', array('revision' => $state->topicTitle, 'topic-title' => $state->topicTitle, 'topic-workflow' => $state->topicWorkflow, 'title' => $state->topicWorkflow->getOwnerTitle(), 'reply-to' => $state->topicTitle, 'extra-data' => array('lqtThreadId' => $topic->getLqtThreadId(), 'notifyAgent' => true), 'timestamp' => $topic->getTimestamp()));
 }