public function loadNode($nodeId, $cardId = null, $name = null, $collapsed = true) { if ($cardId != null) { $card = $this->cm->findById($cardId); $node = new \Model\MindMapCard(); $node->setCard($card); } else { if ($name != null) { $node = new \Model\MindMap(); $node->setName($name); } } $node->setCollapsed($collapsed); $this->assignToView("nodeId", $nodeId); $this->assignToView("node", $node); }
public function createMindMap($name, $x = 0, $y = 0, $z = 0, $width = 120, $height = 80, $isCollapsed = false, \Model\MindMap $parent = null) { $m = new \Model\MindMap(); $m->setOwner($this->um->getLoggedInUser()); $m->setX($x); $m->setY($y); $m->setZ($z); $m->setWidth($width); $m->setHeight($height); $m->setCollapsed($isCollapsed); $m->setName($name); if ($parent != null) { $m->setParent($parent); } $this->em->persist($m); $this->em->flush(); return $m; }