MenuItem::getConditionList PHP 메소드

getConditionList() 공개 메소드

public getConditionList ( boolean | false $condition = false ) : array
$condition boolean | false
리턴 array
    public function getConditionList($condition = false)
    {
        $conditions = [];
        foreach (Yii::app()->getModules() as $key => $value) {
            $key = strtolower($key);
            $module = Yii::app()->getModule($key);
            if ($module !== null && $module instanceof yupe\components\WebModule && isset($module->conditions)) {
                $conditionsList = [];
                foreach ($module->conditions as $keyList => $valueList) {
                    $conditionsList[$keyList] = !$condition ? $valueList['name'] : $valueList['condition'];
                }
                $conditions = array_merge($conditions, $conditionsList);
            }
        }
        return $conditions;
    }