3 namespace Drupal\field\Plugin\migrate\source\d7;
5 use Drupal\migrate\Row;
6 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
9 * Drupal 7 field source from database.
15 class Field extends DrupalSqlBase {
20 public function query() {
21 $query = $this->select('field_config', 'fc')
24 ->fields('fci', ['entity_type'])
25 ->condition('fc.active', 1)
26 ->condition('fc.deleted', 0)
27 ->condition('fc.storage_active', 1);
28 $query->join('field_config_instance', 'fci', 'fc.id = fci.field_id');
36 public function fields() {
38 'field_name' => $this->t('The name of this field.'),
39 'type' => $this->t('The type of this field.'),
40 'module' => $this->t('The module that implements the field type.'),
41 'storage' => $this->t('The field storage.'),
42 'locked' => $this->t('Locked'),
43 'cardinality' => $this->t('Cardinality'),
44 'translatable' => $this->t('Translatable'),
51 public function prepareRow(Row $row, $keep = TRUE) {
52 foreach (unserialize($row->getSourceProperty('data')) as $key => $value) {
53 $row->setSourceProperty($key, $value);
55 return parent::prepareRow($row);
61 public function getIds() {