Beispiel #1
0
 public function getValue()
 {
     $back = debug_backtrace();
     if (isset($back[1]["function"]) && isset($back[1]["class"]) && $back[1]["function"] === "getControl" && $back[1]["class"] === "Nette\\Forms\\SelectBox") {
         return parent::getValue();
     }
     $val = parent::getValue();
     foreach ($this->entities as $item) {
         if ($item->{'get' . $this->idKey}() == $val) {
             return $item;
         }
     }
     return NULL;
 }
Beispiel #2
0
 /**
  * Generates control's HTML element.
  * @return Nette\Web\Html
  */
 public function getControl()
 {
     $control = parent::getControl();
     $control->multiple = TRUE;
     return $control;
 }