Example #1
0
 /**
  * @param bool $singleItemMode
  * @return MessageHandler
  */
 protected function getArticleImporterMessageHandler($singleItemMode = false)
 {
     $supportedProcessingType = $singleItemMode ? Article::prototype() : ArticleCollection::prototype();
     return MessageHandler::fromDefinition(MessageHandlerId::generate(), 'Article Importer', NodeName::defaultName(), MessageHandler\HandlerType::connector(), MessageHandler\DataDirection::target(), MessageHandler\ProcessingTypes::support([$supportedProcessingType]), ProcessingMetadata::fromArray(['chunk_support' => true]), 'sqlconnector-pm-metadata', 'glyphicon-hdd', 'glyphicon');
 }
 /**
  * Returns the prototype of the items type
  *
  * A collection has always one property with name item representing the type of all items in the collection.
  *
  * @return Prototype
  */
 public static function itemPrototype()
 {
     return Article::prototype();
 }
 /**
  * @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'));
 }