Asf_Db_AbstractQueryBuilder


Introduction

Asf_Db_AbstractQueryBuilder DB Query Builder 类

遵循人的书写习惯, 顺序编写SQL

封装了DB操作常用方法, 未提供的方法可使用cm函数进行实现

当非这些情况时(`字段名`, xx.字段名, 字段名*), 用到的字段名会被自动过滤前后空格, 并且在字段名前后加上反引号(`字段名`)

在开启命名空间情况下(asf.use_namespace=1)类名为 Asf\Db\AbstractQueryBuilder

Class synopsis

<?php
abstract class Asf_Db_AbstractQueryBuilder
{
    public object where(string $columns, mixed $value [, string $operator = '='])
    public object wheres(array $cols(string $columns => mixed $value) = array())
    public object orwhere(string $columns, mixed $value [, string $operator = '='])
    public object whereIn(string $columns, array $value)
    public object orWhereIn(string $columns, array $value) 
    public object table(string $name [, string $alias_name = ''])
    public object from(string $name [, string $alias_name = ''])
    public object set(string $name, string $value)
    public object sets(array $cols(string $columns => mixed $value) = array())
    public object limit(int $start_page, int $end_page)

    public object cm(string $data)

    public object like(string $columns, mixed $value)
    public object notLike(string $columns, mixed $value)
    public object between(string $columns, mixed $a, mixed $b)
    public object notBetween(string $columns, mixed $a, mixed $b)

    public string show(void)
    public bool exec(bool $flags = false)
    public bool clear(void)

    public string getSql(void)
    public array getValues(void)
}

Subclass