You are here

class PatternSourceField in UI Patterns 8

Class PatternSourceField.

@package Drupal\ui_patterns\Definition

Hierarchy

Expanded class hierarchy of PatternSourceField

1 file declares its use of PatternSourceField
PatternSourceBase.php in src/Plugin/PatternSourceBase.php

File

src/Definition/PatternSourceField.php, line 10

Namespace

Drupal\ui_patterns\Definition
View source
class PatternSourceField {
  const FIELD_KEY_SEPARATOR = ':';

  /**
   * Field name.
   *
   * @var string
   */
  private $fieldName;

  /**
   * Field label.
   *
   * @var string
   */
  private $fieldLabel;

  /**
   * Plugin ID.
   *
   * @var string
   */
  private $pluginId;

  /**
   * Plugin label.
   *
   * @var string
   */
  private $pluginLabel;

  /**
   * SourceField constructor.
   */
  public function __construct($field_name, $field_label, $plugin_id, $plugin_label) {
    $this->fieldName = $field_name;
    $this->fieldLabel = $field_label;
    $this->pluginId = $plugin_id;
    $this->pluginLabel = $plugin_label;
  }

  /**
   * Get FieldName property.
   *
   * @return string
   *   Property value.
   */
  public function getFieldName() {
    return $this->fieldName;
  }

  /**
   * Set FieldName property.
   *
   * @param string $fieldName
   *   Property value.
   *
   * @return $this
   */
  public function setFieldName($fieldName) {
    $this->fieldName = $fieldName;
    return $this;
  }

  /**
   * Get FieldLabel property.
   *
   * @return string
   *   Property value.
   */
  public function getFieldLabel() {
    return $this->fieldLabel;
  }

  /**
   * Set FieldLabel property.
   *
   * @param string $fieldLabel
   *   Property value.
   *
   * @return $this
   */
  public function setFieldLabel($fieldLabel) {
    $this->fieldLabel = $fieldLabel;
    return $this;
  }

  /**
   * Get Plugin property.
   *
   * @return string
   *   Property value.
   */
  public function getPluginId() {
    return $this->pluginId;
  }

  /**
   * Set Plugin property.
   *
   * @param string $pluginId
   *   Property value.
   *
   * @return $this
   */
  public function setPluginId($pluginId) {
    $this->pluginId = $pluginId;
    return $this;
  }

  /**
   * Get PluginLabel property.
   *
   * @return string
   *   Property value.
   */
  public function getPluginLabel() {
    return $this->pluginLabel;
  }

  /**
   * Set PluginLabel property.
   *
   * @param string $pluginLabel
   *   Property value.
   *
   * @return $this
   */
  public function setPluginLabel($pluginLabel) {
    $this->pluginLabel = $pluginLabel;
    return $this;
  }

  /**
   * Get unique field key.
   *
   * @return string
   *   Field key.
   */
  public function getFieldKey() {
    return $this
      ->getPluginId() . self::FIELD_KEY_SEPARATOR . $this
      ->getFieldName();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PatternSourceField::$fieldLabel private property Field label.
PatternSourceField::$fieldName private property Field name.
PatternSourceField::$pluginId private property Plugin ID.
PatternSourceField::$pluginLabel private property Plugin label.
PatternSourceField::FIELD_KEY_SEPARATOR constant
PatternSourceField::getFieldKey public function Get unique field key.
PatternSourceField::getFieldLabel public function Get FieldLabel property.
PatternSourceField::getFieldName public function Get FieldName property.
PatternSourceField::getPluginId public function Get Plugin property.
PatternSourceField::getPluginLabel public function Get PluginLabel property.
PatternSourceField::setFieldLabel public function Set FieldLabel property.
PatternSourceField::setFieldName public function Set FieldName property.
PatternSourceField::setPluginId public function Set Plugin property.
PatternSourceField::setPluginLabel public function Set PluginLabel property.
PatternSourceField::__construct public function SourceField constructor.