FieldTypeDefaults.php

Same filename in this branch
  1. 9 core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
Same filename in other branches
  1. 8.9.x core/modules/field/src/Plugin/migrate/process/FieldTypeDefaults.php
  2. 8.9.x core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
  3. 8.9.x core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php
  4. 10 core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
  5. 10 core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php
  6. 11.x core/modules/field/src/Plugin/migrate/process/d6/FieldTypeDefaults.php
  7. 11.x core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php

Namespace

Drupal\field\Plugin\migrate\process\d7

File

core/modules/field/src/Plugin/migrate/process/d7/FieldTypeDefaults.php

View source
<?php

namespace Drupal\field\Plugin\migrate\process\d7;

use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Row;

/**
 * Gives us a chance to set per field defaults.
 *
 * @MigrateProcessPlugin(
 *   id = "d7_field_type_defaults"
 * )
 */
class FieldTypeDefaults extends ProcessPluginBase {
    
    /**
     * {@inheritdoc}
     */
    public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
        if (is_array($value) && isset($value[1])) {
            return $value[1];
        }
        return $value;
    }

}

Classes

Title Deprecated Summary
FieldTypeDefaults Gives us a chance to set per field defaults.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.