PHP Класс FluentPDO, fluentpdo

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$convertTypes boolean
$debug boolean | callback

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

Свойство Тип Описание
$pdo PDO
$structure FluentStructure | null

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

Метод Описание
__construct ( PDO $pdo, FluentStructure $structure = null ) FluentPDO constructor.
close ( ) : null Closes the \PDO connection to the database
delete ( string $table, string $primaryKey = null ) : DeleteQuery Create DELETE query
deleteFrom ( string $table, string $primaryKey = null ) : DeleteQuery Create DELETE FROM query
from ( string $table, integer $primaryKey = null ) : SelectQuery Create SELECT query from $table
getPdo ( ) : PDO
getStructure ( ) : FluentStructure
insertInto ( string $table, array $values = [] ) : InsertQuery Create INSERT INTO query
update ( string $table, array | string $set = [], string $primaryKey = null ) : UpdateQuery Create UPDATE query

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

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

FluentPDO constructor.
public __construct ( PDO $pdo, FluentStructure $structure = null )
$pdo PDO
$structure FluentStructure

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

Closes the \PDO connection to the database
public close ( ) : null
Результат null

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

Create DELETE query
public delete ( string $table, string $primaryKey = null ) : DeleteQuery
$table string
$primaryKey string delete only row by primary key
Результат DeleteQuery

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

Create DELETE FROM query
public deleteFrom ( string $table, string $primaryKey = null ) : DeleteQuery
$table string
$primaryKey string
Результат DeleteQuery

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

Create SELECT query from $table
public from ( string $table, integer $primaryKey = null ) : SelectQuery
$table string - db table name
$primaryKey integer - return one row by primary key
Результат SelectQuery

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

public getPdo ( ) : PDO
Результат PDO

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

public getStructure ( ) : FluentStructure
Результат FluentStructure

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

Create INSERT INTO query
public insertInto ( string $table, array $values = [] ) : InsertQuery
$table string
$values array - accepts one or multiple rows, @see docs
Результат InsertQuery

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

Create UPDATE query
public update ( string $table, array | string $set = [], string $primaryKey = null ) : UpdateQuery
$table string
$set array | string
$primaryKey string
Результат UpdateQuery

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

$convertTypes публичное свойство

public bool $convertTypes
Результат boolean

$debug публичное свойство

public bool|callback $debug
Результат boolean | callback

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

protected PDO $pdo
Результат PDO

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

protected FluentStructure|null $structure
Результат FluentStructure | null