Nestable\Services\NestableService::doSelect PHP Метод

doSelect() защищенный Метод

Set the as selected of items.
protected doSelect ( mixed $value, $label ) : string
$value mixed
Результат string
    protected function doSelect($value, $label)
    {
        if ($this->selected) {
            if (is_array($this->selected) && count($this->selected) > 0) {
                $result = array_search($value, $this->selected);
                if ($result !== false) {
                    unset($this->selected[$result]);
                    return 'selected';
                }
            } elseif ($this->selected instanceof Closure) {
                call_user_func_array($this->selected, [$this, $value, $label]);
                $attrs = $this->renderAttr($this->optionAttr);
                $this->optionAttr = null;
            } else {
                if ($this->selected == $value) {
                    $this->selected = null;
                    return 'selected="selected"';
                }
            }
        }
    }