You are here

public function Matrix::getCellByElementUuid in Business Rules 2.x

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

Get one matrix cell by Element UUID.

Parameters

string $uuid: The element uuid.

Return value

null|array The matrix cell or NULL if not found.

7 calls to Matrix::getCellByElementUuid()
Matrix::getBottomCells in src/Util/Flowchart/Matrix.php
Get all not empty cells at bottom of one element.
Matrix::getElementAbove in src/Util/Flowchart/Matrix.php
Get the element above in the matrix.
Matrix::getLeftCells in src/Util/Flowchart/Matrix.php
Get all not empty cells at left of one element.
Matrix::getRightCells in src/Util/Flowchart/Matrix.php
Get all not empty cells at right of one element.
Matrix::leftCellIsEmpty in src/Util/Flowchart/Matrix.php
Check if the cell at left from the element is empty.

... See full list

File

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

Class

Matrix
The matrix to handle the Business Rule flowchart.

Namespace

Drupal\business_rules\Util\Flowchart

Code

public function getCellByElementUuid($uuid) {
  for ($y = 0; $y <= 100; $y++) {
    for ($x = 0; $x <= 100; $x++) {
      $element = $this->matrix[$x][$y]['element'];
      if ($element instanceof Element) {
        if ($element
          ->getUuid() == $uuid) {
          return $this->matrix[$x][$y];
        }
      }
    }
  }
  return NULL;
}