/** * pretezuje o nacitani options z records * @return array */ public function getOptions() { try { if (count($this->options) < 1) { $colnameValue = $this->colnameValue; $colnameLabel = $this->colnameLabel; $colnameTitle = $this->colnameTitle; foreach ($this->optionsPrepend as $optionValue => $optionLabel) { $option = new LBoxFormControlOption($optionValue, $optionLabel); $this->addOption($option); } foreach ($this->records as $record) { $option = new LBoxFormControlOption($record->{$colnameValue}, $record->{$colnameLabel}); $option->title = strlen($colnameTitle) > 0 ? $record->{$colnameTitle} : ""; $this->addOption($option); } foreach ($this->optionsAppend as $optionValue => $optionLabel) { $option = new LBoxFormControlOption($optionValue, $optionLabel); $this->addOption($option); } } return parent::getOptions(); } catch (Exception $e) { throw $e; } }