public function one()
    {
        $data = $this->filter($this->menu[$this->getLang()], $this->_where, $this->_with);

        if (count($data) == 0) {
            return false;
        }

        return static::createItemObject(array_values($data)[0], $this->getLang());
    }
public function one()
    {
        $data = $this->filter($this->menu[$this->getLang()], $this->_where, $this->_with);

        if (count($data) == 0) {
            return false;
        }

        return static::createItemObject(array_values($data)[0], $this->getLang());
    }
public function one ( ) { $ data = $ this -> filter ( $ this -> menu [ $ this -> getLang ( ) ] , $ this -> _where , $ this -> _with ) ; if ( count ( $ data ) == 0 ) { return false ; } return static :: createItemObject ( array_values ( $ data ) [ 0 ] , $ this -> getLang ( ) ) ; }
Retrieve only one result for your query, even if there are more rows then one, it will
just pick the first row from the filtered result and return the item object. If the filtering
based on the query settings does not return any result, the return will be false.

@return \luya\cms\menu\Item|boolean Returns the Item object or false if nothing found.
Retrieve only one result for your query even if there are more rows then one it will just pick the first row from the filtered result and return the item object . If the filtering based on the query settings does not return any result the return will be false .