Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity(Row $row, array $old_destination_id_values)
 {
     if ($row->isStub()) {
         $row->setDestinationProperty('name', $this->t('Stub name for source tid:') . $row->getSourceProperty('tid'));
     }
     return parent::getEntity($row, $old_destination_id_values);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity(Row $row, array $old_destination_id_values)
 {
     $destination = $row->getDestinationProperty($this->configuration['destination_path_property']);
     $entity = $this->storage->loadByProperties(['uri' => $destination]);
     if ($entity) {
         return reset($entity);
     } else {
         return parent::getEntity($row, $old_destination_id_values);
     }
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity(Row $row, array $old_destination_id_values)
 {
     // For stub rows, there is no real file to deal with, let the stubbing
     // process take its default path.
     if ($row->isStub()) {
         return parent::getEntity($row, $old_destination_id_values);
     }
     $destination = $row->getDestinationProperty($this->configuration['destination_path_property']);
     $entity = $this->storage->loadByProperties(['uri' => $destination]);
     if ($entity) {
         return reset($entity);
     } else {
         return parent::getEntity($row, $old_destination_id_values);
     }
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity(Row $row, array $old_destination_id_values)
 {
     // For stub rows, there is no real file to deal with, let the stubbing
     // process take its default path.
     if ($row->isStub()) {
         return parent::getEntity($row, $old_destination_id_values);
     }
     // By default the entity key (fid) would be used, but we want to make sure
     // we're loading the matching URI.
     $destination = $row->getDestinationProperty('uri');
     if (empty($destination)) {
         throw new MigrateException('Destination property uri not provided');
     }
     $entity = $this->storage->loadByProperties(['uri' => $destination]);
     if ($entity) {
         return reset($entity);
     } else {
         return parent::getEntity($row, $old_destination_id_values);
     }
 }