getSiteRepository example

/** * required for creating the tree * takes a nodeName and creates all children for that particular node */
    public function getNodesAction()
    {
        $node = $this->Request()->getParam('node');

        // Create root nodes         if ($node === 'root') {
            try {
                $query = $this->getSiteRepository()->getGroupListQuery();
                $sites = $query->getArrayResult();
                $this->View()->assign(['success' => true, 'nodes' => $sites]);
            } catch (Exception $e) {
                $this->View()->assign(['success' => false, 'message' => $e->getMessage()]);
            }
        } else {
            try {
                // Call the getSitesByNodeName helper function, which will return an array containing all children of that node                 $sites = $this->getSitesByNodeName($node);

                // Hand that array to the view
Home | Imprint | This part of the site doesn't use cookies.