where("`{$this->_tableAlias}`.`enabled` = 'y'"); return $select; } public static function getById($schoolId, $field = false, $default = null) { $db = Qs_Db::getInstance(); $select = $db->select(); $select->from(array('School' => Qs_Db::getTableName('School')), array('*')); $select->where('id = ?', (int) $schoolId, Qs_Db::INT_TYPE); $select->limit(1); $data = $db->fetchRow($select); return $data ? Qs_Array::get($data, $field, $default) : $data; } }