plus-8.x-4.x-dev/src/Annotation/Setting.php

src/Annotation/Setting.php
<?php

namespace Drupal\plus\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a Setting annotation object.
 *
 * Plugin Namespace: "Plugin/Setting".
 *
 * @see \Drupal\plus\SettingInterface
 * @see \Drupal\plus\SettingPluginManager
 * @see plugin_api
 *
 * @Annotation
 *
 * @Attributes({
 * @Attribute("defaultValue", type = "mixed", required = true),
 * @Attribute("type", type = "string", required = true),
 * })
 *
 * @ingroup plugins_setting
 */
class Setting extends Plugin {

  /**
   * The setting's description.
   *
   * @var \Drupal\Core\Annotation\Translation
   */
  public $description;

  /**
   * The setting's default value.
   *
   * @var mixed
   */
  public $defaultValue;

  /**
   * The setting's groups.
   *
   * @var \Drupal\Core\Annotation\Translation[]
   */
  public $groups = [];

  /**
   * The setting's title.
   *
   * @var \Drupal\Core\Annotation\Translation
   */
  public $title;

  /**
   * The setting's type.
   *
   * @var string
   */
  public $type;

  /**
   * The setting's see references.
   *
   * @var array
   */
  public $see = [];

  /**
   * {@inheritdoc}
   */
  public function __construct($values) {
    if (!isset($values['groups'])) {
      $values['groups'] = ['general' => t('General')];
    }
    parent::__construct($values);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc