8297be6ae9ce5ac366ba8858be7ce881daa5ba89
[yaffs-website] / web / core / modules / contact / src / Plugin / migrate / source / ContactSettings.php
1 <?php
2
3 namespace Drupal\contact\Plugin\migrate\source;
4
5 use Drupal\migrate_drupal\Plugin\migrate\source\Variable;
6
7 /**
8  * @MigrateSource(
9  *   id = "contact_settings",
10  *   source_module = "contact"
11  * )
12  */
13 class ContactSettings extends Variable {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected function initializeIterator() {
19     $default_category = $this->select('contact', 'c')
20       ->fields('c', ['cid'])
21       ->condition('c.selected', 1)
22       ->execute()
23       ->fetchField();
24     return new \ArrayIterator([$this->values() + ['default_category' => $default_category]]);
25   }
26
27 }