Asf_Db_AbstractAdapter


Introduction

Asf_Db_AbstractAdapter DB Adapter类, 所有的SQL都会被预处理, 所有的值都会被绑定到参数。

Asf_Db_AbstractAdapter 类使用PHP魔术方法(__call)去调用 PDO 原生类

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

Class synopsis

<?php
abstract class Asf_Db_AbstractAdapter implements Asf_Db_AdapterInterface
{
    public object __construct(array $configs [, bool $reconnection = false]);
    public int insert(array $data [, bool $retrun_insert_id = false])
    public int insertIgnore(array $data [, bool $retrun_insert_id = true])
    public bool update(array $data [, array $condition = array() [, int $limit = 1]])
    public bool delete(array $condition [, int $limit = 1])
    public array findOne(string $sql [, array $bind_value = array() [, int $mode = PDO::FETCH_ASSOC]])
    public array findAll(string $sql [, array $bind_value = array() [, int $mode = PDO::FETCH_ASSOC]])
    public array findOneBy(array $data [, array $fields = array() [, int $mode = PDO::FETCH_ASSOC]])
    public array findAllBy(array $data [, array $fields = array() [, int $mode = PDO::FETCH_ASSOC]])
    public bool exeNoquery(string $sql [, array $bind_value = array()])
    public int exequery(string $sql [, array $bind_value = array()])
    public array getRowByCmd(string $sql [, array $bind_value = array()])
    public array getRowsByCmd(string $sql [, array $bind_value = array())]
    public array addByArray(array $data)
    public array addDupByArray(array $data, array $update_cols)
    public int getCount([string $sql_where = '' [, array $bind_value = array()])
    public bool setTable(string $name)
    public string getTable(void)
    public string getLastSql(void)
    public bool close(void)
    public function __call(string $function_name, array $args)
}

Subclass