private function Flowchart::getItemGraph in Business Rules 2.x
Same name and namespace in other branches
- 8 src/Util/Flowchart/Flowchart.php \Drupal\business_rules\Util\Flowchart\Flowchart::getItemGraph()
Get the item's graph.
Parameters
Element $element: The element.
Return value
array The graph array.
1 call to Flowchart::getItemGraph()
- Flowchart::processMatrix in src/
Util/ Flowchart/ Flowchart.php - Process the matrix.
File
- src/
Util/ Flowchart/ Flowchart.php, line 358
Class
- Flowchart
- Class Flowchart.
Namespace
Drupal\business_rules\Util\FlowchartCode
private function getItemGraph(Element $element) {
$item = $element
->getItem();
$cell = $this->matrix
->getCellByElementUuid($element
->getUuid());
$x = $cell['x'];
$y = $cell['y'];
$meta_data = self::getMetaData($item);
$graph = [];
$graph[] = '<UserObject id="' . $element
->getUuid() . '" label="' . str_replace('"', '', $item
->label()) . '" link="' . $meta_data['link'] . '">';
$graph[] = '<mxCell style="' . $meta_data['style'] . '" parent="1" vertex="1">';
$graph[] = '<mxGeometry x="' . $x . '" y="' . $y . '" width="120" height="60" as="geometry"/>';
$graph[] = '</mxCell>';
$graph[] = '</UserObject>';
return $graph;
}