Asf_Db_AdapterInterface

Introduction

Asf_Db_AdapterInterface DB接口类

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

Class synopsis

<?php
interface 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)
}

Asf_Db_AbstractAdapter

Introduction

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

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

Class synopsis

(节约页面空间, 省略相同的方法)

<?php
abstract class Asf_Db_AbstractAdapter implements Asf_Db_AdapterInterface
{
    protected $_type  = NULL;
    protected $_dbh   = NULL;
    protected $_table = NULL;

    public function __construct(array $configs, bool $reconnection = false);
    public function __call(string $function_name, array $args)
    public function close(void)
}

Asf_Db_Adapter_Mysql

Introduction

Asf_Db_Adapter_Mysql Connecting to MySQL databases

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

Class synopsis

<?php
final class Asf_Db_Adapter_Mysql extends Asf_Db_AbstractAdapter
{
    protected $_type = 'mysql';
}

Asf_Db_Adapter_Sqlite

Introduction

Asf_Db_Adapter_Sqlite Connecting to SQLite databases

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

Class synopsis

<?php
final class Asf_Db_Adapter_Sqlite extends Asf_Db_AbstractAdapter
{
    protected $_type = 'sqlite';
}

Asf_Db_Adapter_Pgsql

Introduction

Asf_Db_Adapter_Pgsql Connecting to PostgreSQL databases

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

Class synopsis

<?php
final class Asf_Db_Adapter_Pgsql extends Asf_Db_AbstractAdapter
{
    protected $_type = 'pgsql';
}