ContactSettings.php

Same filename in other branches
  1. 9 core/modules/contact/src/Plugin/migrate/source/ContactSettings.php
  2. 8.9.x core/modules/contact/src/Plugin/migrate/source/ContactSettings.php
  3. 11.x core/modules/contact/src/Plugin/migrate/source/ContactSettings.php

Namespace

Drupal\contact\Plugin\migrate\source

File

core/modules/contact/src/Plugin/migrate/source/ContactSettings.php

View source
<?php

namespace Drupal\contact\Plugin\migrate\source;

use Drupal\migrate_drupal\Plugin\migrate\source\Variable;

/**
 * Drupal 6/7 contact settings source from database.
 *
 * For available configuration keys, refer to the parent classes.
 *
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "contact_settings",
 *   source_module = "contact"
 * )
 */
class ContactSettings extends Variable {
    
    /**
     * {@inheritdoc}
     */
    protected function initializeIterator() {
        $default_category = $this->select('contact', 'c')
            ->fields('c', [
            'cid',
        ])
            ->condition('c.selected', 1)
            ->execute()
            ->fetchField();
        return new \ArrayIterator([
            $this->values() + [
                'default_category' => $default_category,
            ],
        ]);
    }

}

Classes

Title Deprecated Summary
ContactSettings Drupal 6/7 contact settings source from database.

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