public function __construct(ObjectManager $manager) { parent::__construct('G'); $this->attr('node', array('shape' => 'record')); $this->set('rankdir', 'LR'); $data = $this->createData($manager); $clusters = array(); foreach ($data['entities'] as $class => $entity) { $clusterName = $this->getCluster($class); if (!isset($clusters[$clusterName])) { $clusters[$clusterName] = $this->subgraph('cluster_' . $clusterName)->set('label', $clusterName)->set('style', 'filled')->set('color', '#eeeeee')->attr('node', array('style' => 'filled', 'color' => '#eecc88', 'fillcolor' => '#FCF0AD')); } $label = $this->getEntityLabel($class, $entity); $clusters[$clusterName]->node($class, array('label' => $label)); } foreach ($data['relations'] as $association) { $attr = array(); switch ($association['type']) { case 'one_to_one': case 'one_to_many': case 'many_to_one': case 'many_to_many': $attr['color'] = '#88888888'; $attr['arrowhead'] = 'none'; break; case 'extends': } $this->edge(array($association['from'], $association['to']), $attr); } }
public function __construct($id, array $definitions, array $options = array()) { parent::__construct($id); $this->definitions = $definitions; $this->options = $options; }