/** * @param $dataDirection * @param null|string $handlerType * @param null|array $metadata * @return MessageHandler */ private function getMessageHandler($dataDirection, $handlerType = null, array $metadata = null) { if (!is_null($handlerType)) { $handlerType = MessageHandler\HandlerType::fromString($handlerType); } else { $handlerType = MessageHandler\HandlerType::connector(); } if (!is_null($metadata)) { $metadata = ProcessingMetadata::fromArray($metadata); } else { $metadata = ProcessingMetadata::noData(); } return MessageHandler::fromDefinition(MessageHandlerId::generate(), 'Article Export', NodeName::defaultName(), $handlerType, MessageHandler\DataDirection::fromString($dataDirection), MessageHandler\ProcessingTypes::support([ArticleCollection::prototype(), Article::prototype()]), $metadata, 'sqlconnector-pm-metadata', 'glyphicon-hdd', 'glyphicon', Article::prototype(), MessageHandler\ProcessingId::fromString('sqlconnector:::example')); }
/** * @return DataDirection */ public function dataDirection() { return DataDirection::fromString($this->payload['data_direction']); }
/** * @return DataDirection */ public function dataDirection() { if (is_null($this->dataDirection)) { $this->dataDirection = DataDirection::fromString($this->payload['data_direction']); } return $this->dataDirection; }