You are here

public function Matrix::putRootElement in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Util/Flowchart/Matrix.php \Drupal\business_rules\Util\Flowchart\Matrix::putRootElement()

Put the root element at the matrix.

Parameters

\Drupal\business_rules\Util\Flowchart\Element $element: The element.

File

src/Util/Flowchart/Matrix.php, line 330

Class

Matrix
The matrix to handle the Business Rule flowchart.

Namespace

Drupal\business_rules\Util\Flowchart

Code

public function putRootElement(Element $element) {
  $this
    ->putElementInPosition($element, 0, 0);
  $this->rootElement = $element;
  if ($element
    ->getItem() instanceof BusinessRule) {
    $this->numberOfRootItems = count($element
      ->getItem()
      ->getItems());
  }
}