"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php" (26 Nov 2020, 1207 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "TaxonomyTermReference.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Drupal\taxonomy\Plugin\migrate\cckfield;
    4 
    5 @trigger_error('TaxonomyTermReference is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\taxonomy\Plugin\migrate\field\TaxonomyTermReference instead.', E_USER_DEPRECATED);
    6 
    7 use Drupal\migrate\Plugin\MigrationInterface;
    8 use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
    9 
   10 /**
   11  * @MigrateCckField(
   12  *   id = "taxonomy_term_reference",
   13  *   type_map = {
   14  *     "taxonomy_term_reference" = "entity_reference"
   15  *   },
   16  *   core = {6,7},
   17  *   source_module = "taxonomy",
   18  *   destination_module = "core",
   19  * )
   20  *
   21  * @deprecated in drupal:8.4.0 and is removed from drupal:9.0.0. Use
   22  * \Drupal\taxonomy\Plugin\migrate\field\TaxonomyTermReference instead.
   23  *
   24  * @see https://www.drupal.org/node/2751897
   25  */
   26 class TaxonomyTermReference extends CckFieldPluginBase {
   27 
   28   /**
   29    * {@inheritdoc}
   30    */
   31   public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
   32     $process = [
   33       'plugin' => 'sub_process',
   34       'source' => $field_name,
   35       'process' => [
   36         'target_id' => 'tid',
   37       ],
   38     ];
   39     $migration->setProcessOfProperty($field_name, $process);
   40   }
   41 
   42 }