You are here

class VariableObject in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/VariableObject.php \Drupal\business_rules\VariableObject

Class Variable to be used on BusinessRulesVariable plugins.

@package Drupal\business_rules

Hierarchy

Expanded class hierarchy of VariableObject

17 files declare their use of VariableObject
AddRoleToUser.php in src/Plugin/BusinessRulesAction/AddRoleToUser.php
BusinessRulesItemPluginBase.php in src/Plugin/BusinessRulesItemPluginBase.php
BusinessRulesProcessor.php in src/Util/BusinessRulesProcessor.php
CalculateValue.php in src/Plugin/BusinessRulesAction/CalculateValue.php
CustomValueVariable.php in src/Plugin/BusinessRulesVariable/CustomValueVariable.php

... See full list

File

src/VariableObject.php, line 10

Namespace

Drupal\business_rules
View source
class VariableObject {

  /**
   * The variable ID.
   *
   * @var string
   */
  protected $id;

  /**
   * The variable value.
   *
   * @var mixed
   */
  protected $value;

  /**
   * The variable type.
   *
   * @var string
   */
  protected $type;

  /**
   * VariableObject constructor.
   *
   * @param string $id
   *   The variable id.
   * @param mixed $value
   *   The variable value.
   * @param string $type
   *   The variable type.
   */
  public function __construct($id = NULL, $value = NULL, $type = NULL) {
    $this
      ->setId($id);
    $this
      ->setValue($value);
    $this
      ->setType($type);
  }

  /**
   * Get the variable id.
   *
   * @return string
   *   The variable id.
   */
  public function getId() {
    return $this->id;
  }

  /**
   * Set the variable id.
   *
   * @param string $id
   *   The variable id.
   */
  public function setId($id) {
    $this->id = $id;
  }

  /**
   * Get the variable value.
   *
   * @return mixed
   *   The variable value.
   */
  public function getValue() {
    return $this->value;
  }

  /**
   * Set the variable value.
   *
   * @param mixed $value
   *   The variable value.
   */
  public function setValue($value) {
    $this->value = $value;
  }

  /**
   * Get the variable type, usually the plugin id.
   *
   * @return string
   *   The variable type.
   */
  public function getType() {
    return $this->type;
  }

  /**
   * Set the variable type, usually the plugin id..
   *
   * @param string $type
   *   The variable type.
   */
  public function setType($type) {
    $this->type = $type;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
VariableObject::$id protected property The variable ID.
VariableObject::$type protected property The variable type.
VariableObject::$value protected property The variable value.
VariableObject::getId public function Get the variable id.
VariableObject::getType public function Get the variable type, usually the plugin id.
VariableObject::getValue public function Get the variable value.
VariableObject::setId public function Set the variable id.
VariableObject::setType public function Set the variable type, usually the plugin id..
VariableObject::setValue public function Set the variable value.
VariableObject::__construct public function VariableObject constructor.