PHP Class FluentPDO, fluentpdo

Afficher le fichier Open project: fpdo/fluentpdo Class Usage Examples

Méthodes publiques

Свойство Type Description
$convertTypes boolean
$debug boolean | callback

Protected Properties

Свойство Type Description
$pdo PDO
$structure FluentStructure | null

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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

close() public méthode

Closes the \PDO connection to the database
public close ( ) : null
Résultat null

delete() public méthode

Create DELETE query
public delete ( string $table, string $primaryKey = null ) : DeleteQuery
$table string
$primaryKey string delete only row by primary key
Résultat DeleteQuery

deleteFrom() public méthode

Create DELETE FROM query
public deleteFrom ( string $table, string $primaryKey = null ) : DeleteQuery
$table string
$primaryKey string
Résultat DeleteQuery

from() public méthode

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
Résultat SelectQuery

getPdo() public méthode

public getPdo ( ) : PDO
Résultat PDO

getStructure() public méthode

public getStructure ( ) : FluentStructure
Résultat FluentStructure

insertInto() public méthode

Create INSERT INTO query
public insertInto ( string $table, array $values = [] ) : InsertQuery
$table string
$values array - accepts one or multiple rows, @see docs
Résultat InsertQuery

update() public méthode

Create UPDATE query
public update ( string $table, array | string $set = [], string $primaryKey = null ) : UpdateQuery
$table string
$set array | string
$primaryKey string
Résultat UpdateQuery

Property Details

$convertTypes public_oe property

public bool $convertTypes
Résultat boolean

$debug public_oe property

public bool|callback $debug
Résultat boolean | callback

$pdo protected_oe property

protected PDO $pdo
Résultat PDO

$structure protected_oe property

protected FluentStructure|null $structure
Résultat FluentStructure | null