PHP Класс MockDatabase

This is a mockery of our DB class! ... for testing purposes.
Наследование: extends Airship\Engine\Database
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$expect array

Открытые методы

Метод Описание
__construct ( PDO $pdo = null, string $dbengine = '' ) Dependency-Injectable constructor
beginTransaction ( ) : boolean
column ( string $statement, array $params = [], integer $offset )
commit ( ) : boolean
escapeValueSet ( array $values, string $type = 'string' ) : string
expect ( string $statement = '', null $result = null ) : self
factory ( $dsn, string $username = '', string $password = '', $options = [] ) : Database
getExpected ( string $statement = '' ) : mixed
insert ( string $table, array $map = [] )
insertGet ( string $table, array $map, string $field )
insertMany ( string $table, array $maps ) : boolean
row ( string $statement, $params )
run ( string $statement, $params )
safeQuery ( string $statement, array $params = [], integer $fetch_style = PDO::FETCH_ASSOC )
single ( string $statement, array $params = [] )
update ( string $table, array $changes, array $conditions )

Описание методов

__construct() публичный Метод

Dependency-Injectable constructor
public __construct ( PDO $pdo = null, string $dbengine = '' )
$pdo PDO
$dbengine string

beginTransaction() публичный Метод

public beginTransaction ( ) : boolean
Результат boolean

column() публичный Метод

public column ( string $statement, array $params = [], integer $offset )
$statement string
$params array
$offset integer

commit() публичный Метод

public commit ( ) : boolean
Результат boolean

escapeValueSet() публичный Метод

public escapeValueSet ( array $values, string $type = 'string' ) : string
$values array
$type string
Результат string

expect() публичный Метод

public expect ( string $statement = '', null $result = null ) : self
$statement string
$result null
Результат self

factory() публичный статический Метод

public static factory ( $dsn, string $username = '', string $password = '', $options = [] ) : Database
$username string
$password string
Результат Airship\Engine\Database

getExpected() публичный Метод

public getExpected ( string $statement = '' ) : mixed
$statement string
Результат mixed

insert() публичный Метод

public insert ( string $table, array $map = [] )
$table string
$map array

insertGet() публичный Метод

public insertGet ( string $table, array $map, string $field )
$table string
$map array
$field string

insertMany() публичный Метод

public insertMany ( string $table, array $maps ) : boolean
$table string
$maps array
Результат boolean

row() публичный Метод

public row ( string $statement, $params )
$statement string

run() публичный Метод

public run ( string $statement, $params )
$statement string

safeQuery() публичный Метод

public safeQuery ( string $statement, array $params = [], integer $fetch_style = PDO::FETCH_ASSOC )
$statement string
$params array
$fetch_style integer

single() публичный Метод

public single ( string $statement, array $params = [] )
$statement string
$params array

update() публичный Метод

public update ( string $table, array $changes, array $conditions )
$table string
$changes array
$conditions array

Описание свойств

$expect защищенное свойство

protected array $expect
Результат array