function isLevelSelected($levelObject)
    {
        if ($this->level != $this->leafLevel()) {
            return (bool)($levelObject->getId() == $this->searchForm->getSelected($this->level));
        }
        VF_Singleton::getInstance()->setRequest($this->searchForm->getRequest());
        $currentSelection = VF_Singleton::getInstance()->vehicleSelection();
        if (false === $currentSelection) {
            return false;
        }
        if ('year_start' == $this->yearRangeAlias) {
            return (bool)($levelObject->getTitle() == $this->earliestYearInVehicles($currentSelection));
        } else {
            if ('year_end' == $this->yearRangeAlias) {
                return (bool)($levelObject->getTitle() == $this->latestYearInVehicles($currentSelection));
            }
        }
        $level = false;
        if (is_array($currentSelection) && count($currentSelection) == 1) {
            $firstVehicle = $currentSelection[0];
            /** @var VF_Vehicle $firstVehicle */
            $level = $firstVehicle->getLevel($this->leafLevel());
        } elseif ($currentSelection instanceof VF_Vehicle) {
            $level = $currentSelection->getLevel($this->leafLevel());
        }
        if ($level) {
            return (bool)($levelObject->getTitle() == $level->getTitle());
        }
    }
function isLevelSelected($levelObject)
    {
        if ($this->level != $this->leafLevel()) {
            return (bool)($levelObject->getId() == $this->searchForm->getSelected($this->level));
        }
        VF_Singleton::getInstance()->setRequest($this->searchForm->getRequest());
        $currentSelection = VF_Singleton::getInstance()->vehicleSelection();
        if (false === $currentSelection) {
            return false;
        }
        if ('year_start' == $this->yearRangeAlias) {
            return (bool)($levelObject->getTitle() == $this->earliestYearInVehicles($currentSelection));
        } else {
            if ('year_end' == $this->yearRangeAlias) {
                return (bool)($levelObject->getTitle() == $this->latestYearInVehicles($currentSelection));
            }
        }
        $level = false;
        if (is_array($currentSelection) && count($currentSelection) == 1) {
            $firstVehicle = $currentSelection[0];
            /** @var VF_Vehicle $firstVehicle */
            $level = $firstVehicle->getLevel($this->leafLevel());
        } elseif ($currentSelection instanceof VF_Vehicle) {
            $level = $currentSelection->getLevel($this->leafLevel());
        }
        if ($level) {
            return (bool)($levelObject->getTitle() == $level->getTitle());
        }
    }
function isLevelSelected ( $ levelObject ) { if ( $ this -> level != $ this -> leafLevel ( ) ) { return ( bool ) ( $ levelObject -> getId ( ) == $ this -> searchForm -> getSelected ( $ this -> level ) ) ; } VF_Singleton :: getInstance ( ) -> setRequest ( $ this -> searchForm -> getRequest ( ) ) ; $ currentSelection = VF_Singleton :: getInstance ( ) -> vehicleSelection ( ) ; if ( false === $ currentSelection ) { return false ; } if ( 'year_start' == $ this -> yearRangeAlias ) { return ( bool ) ( $ levelObject -> getTitle ( ) == $ this -> earliestYearInVehicles ( $ currentSelection ) ) ; } else { if ( 'year_end' == $ this -> yearRangeAlias ) { return ( bool ) ( $ levelObject -> getTitle ( ) == $ this -> latestYearInVehicles ( $ currentSelection ) ) ; } } $ level = false ; if ( is_array ( $ currentSelection ) && count ( $ currentSelection ) == 1 ) { $ firstVehicle = $ currentSelection [ 0 ] ; /** @var VF_Vehicle $firstVehicle */ $ level = $ firstVehicle -> getLevel ( $ this -> leafLevel ( ) ) ; } elseif ( $ currentSelection instanceof VF_Vehicle ) { $ level = $ currentSelection -> getLevel ( $ this -> leafLevel ( ) ) ; } if ( $ level ) { return ( bool ) ( $ levelObject -> getTitle ( ) == $ level -> getTitle ( ) ) ; } }
Check if an entity is the selected one for this 'level'

@param VF_Level $levelObject - level to check if is selected

@return bool if this is the one that is supposed to be currently selected
Check if an entity is the selected one for this level