コード例 #1
0
 /**
  * @inheritdoc
  */
 public function logSuccessItem(SuccessItemEvent $event)
 {
     $ident = $this->getLogIdent($event->getImporter()->getImport());
     $source = $event->getResult();
     $originalId = $event->getItem()->getOriginalId();
     $context = ['result' => 'success', 'item' => (string) $event->getItem(), 'source' => $source->getId()];
     $this->doLog($ident, $originalId, $context);
 }
コード例 #2
0
 /**
  * @param SuccessItemEvent $event
  */
 public function onItemSuccess(SuccessItemEvent $event)
 {
     $char = '✎';
     $result = 'modified';
     if (!$event->getResult()->getId()) {
         $char = '✚';
         $result = 'added';
     }
     $result = str_pad($result, 9, ' ', STR_PAD_LEFT);
     $this->logger->info(sprintf('%s %s: %s', $char, $result, (string) $event->getItem()));
 }