예제 #1
0
 /**
  * @param \Spryker\Shared\EventJournal\Model\EventInterface $event
  *
  * @return string
  */
 protected function getJsonEntry(EventInterface $event)
 {
     $json = json_encode($event->getFields());
     if ($json === false) {
         return '';
     }
     return $json . "\n";
 }
예제 #2
0
 /**
  * @param \Spryker\Shared\EventJournal\Model\EventInterface $event
  *
  * @return bool
  */
 public function write(EventInterface $event)
 {
     echo json_encode($event->getFields(), JSON_PRETTY_PRINT);
     return true;
 }
예제 #3
0
 /**
  * @param \Spryker\Shared\EventJournal\Model\EventInterface $event
  *
  * @return void
  */
 public function filter(EventInterface $event)
 {
     $event->setFields($this->getFilteredFields($event->getFields()));
 }
예제 #4
0
 /**
  * @param \Spryker\Shared\EventJournal\Model\EventInterface $event
  *
  * @return void
  */
 protected static function addDeploymentInformation(EventInterface $event)
 {
     $deploymentInformation = (new Version())->toArray();
     foreach ($deploymentInformation as $name => $data) {
         if (!empty($data)) {
             $event->setField('deployment_' . $name, $data);
         }
     }
 }
예제 #5
0
 /**
  * @param \Spryker\Shared\EventJournal\Model\EventInterface $event
  *
  * @return void
  */
 public function applyCollectors(EventInterface $event)
 {
     foreach ($this->dataCollectors as $collector) {
         $event->setFields($collector->getData());
     }
 }