/** * @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"; }
/** * @param \Spryker\Shared\EventJournal\Model\EventInterface $event * * @return bool */ public function write(EventInterface $event) { echo json_encode($event->getFields(), JSON_PRETTY_PRINT); return true; }
/** * @param \Spryker\Shared\EventJournal\Model\EventInterface $event * * @return void */ public function filter(EventInterface $event) { $event->setFields($this->getFilteredFields($event->getFields())); }
/** * @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); } } }
/** * @param \Spryker\Shared\EventJournal\Model\EventInterface $event * * @return void */ public function applyCollectors(EventInterface $event) { foreach ($this->dataCollectors as $collector) { $event->setFields($collector->getData()); } }