<?php
class HouseType extends Db_Model
{
static $table_name = 'house_type';
static $types = [
1 => 'Панельно-монолитный',
2 => 'Монолитный',
3 => 'Кирпично-монолитный',
];
public static function getId($name) {
if (empty($name)) return 0;
$types = array_flip(self::$types);
return isset($types[$name]) ? $types[$name] : 0;
}
}