You are here

class Element in Business Rules 2.x

Same name and namespace in other branches
  1. 8 src/Util/Flowchart/Element.php \Drupal\business_rules\Util\Flowchart\Element

Class Element.

@package Drupal\business_rules\Util\Flowchart

Hierarchy

  • class \Drupal\business_rules\Util\Flowchart\Element

Expanded class hierarchy of Element

File

src/Util/Flowchart/Element.php, line 12

Namespace

Drupal\business_rules\Util\Flowchart
View source
class Element {

  /**
   * The arrow label.
   *
   * @var string
   */
  protected $arrowLabel;

  /**
   * The Business Rule item.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $item;

  /**
   * The connector origin uuid.
   *
   * @var string
   */
  protected $originUuid;

  /**
   * The Item parent.
   *
   * @var \Drupal\business_rules\Util\Flowchart\Element
   */
  protected $parent;

  /**
   * The element uuid.
   *
   * @var string
   */
  protected $uuid;

  /**
   * Element constructor.
   *
   * @param \Drupal\Core\Entity\EntityInterface|null $item
   *   The entity.
   * @param \Drupal\business_rules\Util\Flowchart\Element|null $parent
   *   The parent entity.
   * @param string $originUUid
   *   The uuid for the origin element. The arrow beginning.
   * @param string $arrowLabel
   *   The arrow label.
   */
  public function __construct(EntityInterface $item = NULL, Element $parent = NULL, $originUUid = '', $arrowLabel = '') {
    $this
      ->setItem($item);
    $this->parent = $parent;
    $this
      ->setOriginUuid($originUUid);
    $this
      ->setArrowLabel($arrowLabel);
    $this->uuid = \Drupal::service('uuid')
      ->generate();
  }

  /**
   * Get the arrow label.
   *
   * @return string
   *   The label.
   */
  public function getArrowLabel() {
    return $this->arrowLabel;
  }

  /**
   * Set the arrow label.
   *
   * @param string $arrowLabel
   *   The label.
   */
  public function setArrowLabel($arrowLabel) {
    $this->arrowLabel = $arrowLabel;
  }

  /**
   * Get the item element.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The item.
   */
  public function getItem() {
    return $this->item;
  }

  /**
   * Set the item element.
   *
   * @param \Drupal\Core\Entity\EntityInterface $item
   *   The item.
   */
  public function setItem(EntityInterface $item) {
    $this->item = $item;
  }

  /**
   * Get the graph origin uuid.
   *
   * @return string
   *   The origin id.
   */
  public function getOriginUuid() {
    return $this->originUuid;
  }

  /**
   * Set the graph origin uuid.
   *
   * @param string $originUuid
   *   The graph origin uuid.
   */
  public function setOriginUuid($originUuid) {
    $this->originUuid = $originUuid;
  }

  /**
   * Get the parent item.
   *
   * @return \Drupal\business_rules\Util\Flowchart\Element
   *   The parent element.
   */
  public function getParent() {
    return $this->parent;
  }

  /**
   * Set the parent item.
   *
   * @param \Drupal\business_rules\Util\Flowchart\Element $parent
   *   The parent item.
   */
  public function setParent(Element $parent) {
    $this->parent = $parent;
  }

  /**
   * Get the element uuid.
   *
   * @return string
   *   The element uuid.
   */
  public function getUuid() {
    return $this->uuid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Element::$arrowLabel protected property The arrow label.
Element::$item protected property The Business Rule item.
Element::$originUuid protected property The connector origin uuid.
Element::$parent protected property The Item parent.
Element::$uuid protected property The element uuid.
Element::getArrowLabel public function Get the arrow label.
Element::getItem public function Get the item element.
Element::getOriginUuid public function Get the graph origin uuid.
Element::getParent public function Get the parent item.
Element::getUuid public function Get the element uuid.
Element::setArrowLabel public function Set the arrow label.
Element::setItem public function Set the item element.
Element::setOriginUuid public function Set the graph origin uuid.
Element::setParent public function Set the parent item.
Element::__construct public function Element constructor.