159c159 < index 900db6a..502d606 100644 --- > index 900db6a..6374251 100644 162,164c162,168 < @@ -7,19 +7,12 @@ < use Drupal\Core\Entity\EntityStorageInterface; < use Drupal\Core\Field\FieldTypePluginManagerInterface; --- > @@ -3,23 +3,12 @@ > namespace Drupal\file\Plugin\migrate\destination; > > use Drupal\Component\Utility\Unicode; > -use Drupal\Core\Entity\EntityManagerInterface; > -use Drupal\Core\Entity\EntityStorageInterface; > -use Drupal\Core\Field\FieldTypePluginManagerInterface; 169c173 < use Drupal\migrate\Plugin\MigrationInterface; --- > -use Drupal\migrate\Plugin\MigrationInterface; 182c186 < @@ -27,50 +20,18 @@ --- > @@ -27,50 +16,9 @@ 190,192c194,195 < + protected $uri_column; < < /** --- > - > - /** 194,195c197 < + * @inheritdoc < */ --- > - */ 209,210c211 < + public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager) { < parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $entity_manager, $field_type_manager); --- > - parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $entity_manager, $field_type_manager); 214,216c215,216 < + $this->uri_column = isset($configuration['uri_column']) ? $configuration['uri_column'] : 'uri'; < } < --- > - } > - 234a235 > + const URI_COLUMN = 'uri'; 238c239 < @@ -82,8 +43,10 @@ protected function getEntity(Row $row, array $old_destination_id_values) { --- > @@ -82,8 +30,10 @@ protected function getEntity(Row $row, array $old_destination_id_values) { 246,247c247,248 < + $destination = $row->getDestinationProperty($this->uri_column); < + $entity = $this->storage->loadByProperties([$this->uri_column => $destination]); --- > + $destination = $row->getDestinationProperty(static::URI_COLUMN); > + $entity = $this->storage->loadByProperties([static::URI_COLUMN => $destination]); 251c252 < @@ -95,188 +58,13 @@ protected function getEntity(Row $row, array $old_destination_id_values) { --- > @@ -95,188 +45,13 @@ protected function getEntity(Row $row, array $old_destination_id_values) { 433c434 < + if (!$row->getDestinationProperty($this->uri_column)) { --- > + if (!$row->getDestinationProperty(static::URI_COLUMN)) { 438c439 < + $value = UriItem::generateSampleValue($field_definitions[$this->uri_column]); --- > + $value = UriItem::generateSampleValue($field_definitions[static::URI_COLUMN]); 442c443 < @@ -285,10 +73,10 @@ protected function processStubRow(Row $row) { --- > @@ -285,10 +60,10 @@ protected function processStubRow(Row $row) { 447c448 < + $value = Unicode::substr($value, 0, $field_definitions[$this->uri_column]->getSetting('max_length')); --- > + $value = Unicode::substr($value, 0, $field_definitions[static::URI_COLUMN]->getSetting('max_length')); 451c452 < + $row->setDestinationProperty($this->uri_column, $value); --- > + $row->setDestinationProperty(static::URI_COLUMN, $value);