You are here

public function Matrix::getAllCellWithElements 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::getAllCellWithElements()

Get all cell with elements from the matrix.

Return value

array The elements in cells.

File

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

Class

Matrix
The matrix to handle the Business Rule flowchart.

Namespace

Drupal\business_rules\Util\Flowchart

Code

public function getAllCellWithElements() {
  $cells = [];
  for ($y = 0; $y <= 100; $y++) {
    for ($x = 0; $x <= 100; $x++) {
      if (is_object($this->matrix[$x][$y]['element'])) {
        $cells[] = $this->matrix[$x][$y];
      }
    }
  }
  return $cells;
}