public static function getList() { $list = new self(); $list->sortBy('formName'); $formTypes = $list->get(0); $result = []; foreach ($formTypes as $formType) { $result[$formType->getID()] = $formType->getFormName(); } return $result; }
/** * Adds a child to the item * @param string $label * @param string $url * @param mixed $priority * @param int $sortBy */ public function add($label, $url = '#', $priority = NULL, $sortBy = NULL) { // checks if given label is valid if (!is_string($label) || empty($label)) { $type = gettype($label); throw new InvalidArgumentException("Label parameter must be be a string and must not be empty, '{$label}' of type {$type} given."); } $node = new self(); $node->label = $label; $node->url = $url; $node->sortBy($sortBy != NULL ? $sortBy : $this->sortBy); $node->priority = $priority != NULL ? $priority : $this->defaultPriority; $node->defaultPriority = $this->defaultPriority; $this->addComponent($node, ++$this->counter); return $this; }