Ejemplo n.º 1
0
 /**
  * @param string $message
  * @param ProcessTrigger $trigger
  * @param ProcessData $data
  */
 public function debug($message, ProcessTrigger $trigger, ProcessData $data)
 {
     if ($this->logger) {
         $context = array('definition' => $trigger->getDefinition()->getName());
         if ($trigger->getEvent()) {
             $context['event'] = $trigger->getEvent();
         }
         if ($trigger->getCron()) {
             $context['cron'] = $trigger->getCron();
         }
         if ($data['data']) {
             $context['entityId'] = $this->doctrineHelper->getSingleEntityIdentifier($data['data'], false);
         }
         $this->logger->debug($message, $context);
     }
 }
 /**
  * @param array $expected
  * @param ProcessDefinition $definition
  * @param ProcessTrigger $trigger
  */
 protected function assertProcessTrigger(array $expected, ProcessDefinition $definition, ProcessTrigger $trigger)
 {
     $this->assertEquals($expected['event'], $trigger->getEvent());
     $this->assertEquals($expected['field'], $trigger->getField());
     $this->assertEquals($expected['queued'], $trigger->isQueued());
     $this->assertEquals($expected['priority'], $trigger->getPriority());
     $this->assertSame($expected['time_shift'], $trigger->getTimeShift());
     $this->assertSame($expected['cron'], $trigger->getCron());
     $this->assertSame($definition, $trigger->getDefinition());
 }
 /**
  * @param ProcessTrigger $trigger
  * @return null|ProcessTrigger
  */
 public function findEqualTrigger(ProcessTrigger $trigger)
 {
     return $this->findOneBy(array('event' => $trigger->getEvent(), 'field' => $trigger->getField(), 'definition' => $trigger->getDefinition(), 'cron' => $trigger->getCron()));
 }
Ejemplo n.º 4
0
 /**
  * @param ProcessTrigger $trigger
  * @return ProcessTrigger
  */
 public function import(ProcessTrigger $trigger)
 {
     $this->setEvent($trigger->getEvent())->setField($trigger->getField())->setPriority($trigger->getPriority())->setQueued($trigger->isQueued())->setTimeShift($trigger->getTimeShift())->setDefinition($trigger->getDefinition())->setCron($trigger->getCron());
     return $this;
 }