/** * @param string action * @param mixed $constrain * @return array */ public static function getCategories($constrain = null) { $ret_val = []; $where = is_array($constrain) ? $constrain : ['type_id' => 1]; return Category::find()->where($where)->orderBy('slug'); }