public static function getAllCity() { if (self::$_allCity === null) { $sql = 'SELECT name_' . Yii::app()->language . ' AS name, id FROM {{apartment_city}} ORDER BY sorter'; $results = Yii::app()->db->createCommand($sql)->queryAll(); self::$_allCity = CHtml::listData($results, 'id', 'name'); } return self::$_allCity; }