entity.php
public static function getOne($field,$where = "")
    {
        $class = get_called_class();
        $meta = $class::getMetadata();
        $conn = DB::getConnect();

        $table = isset($meta['view']) ? $meta['view'] : $meta['table'];
        $sql = "select {$field} from " . $table;


        if (strlen($where) > 0) {
            $sql .= " where " . $where;
        }


        return $conn->getOne($sql);
    }
public static function getOne($field,$where = "")
    {
        $class = get_called_class();
        $meta = $class::getMetadata();
        $conn = DB::getConnect();

        $table = isset($meta['view']) ? $meta['view'] : $meta['table'];
        $sql = "select {$field} from " . $table;


        if (strlen($where) > 0) {
            $sql .= " where " . $where;
        }


        return $conn->getOne($sql);
    }
Возвращает  одно скалярное  значение  из одной строки
@param mixed $field  возвращаемое  поле  или  выражение
@param mixed $where