PHP Класс PdoDataSource, recess

Автор: Kris Jordan ([email protected])
Наследование: extends PDO
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$cachePrefix
$provider

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

Метод Описание
__construct ( mixed $dsn, string $username = '', string $password = '', array $driver_options = [] ) Creates a data source instance to represent a connection to the database.
cascadeTableDescriptor ( string $table, RecessTableDescriptor $descriptor ) Take a table descriptor and apply it / verify it on top of the table descriptor returned from a database. This is used to ensure a model's marked up fields are in congruence with the table. Also checks to ensure the number of columns in the cascaded descriptor do not outnumber the actual number of columns. Finally with a database like sqlite which largely ignores column typing it enables the model to inform the actual Recess type of the column.
createTableSql ( $tableDescriptor )
dropTable ( string $table ) Drop a table from the database.
emptyTable ( string $table ) Empty a table in the database.
executeSqlBuilder ( SqlBuilder $builder, string $action ) : boolean Execute the query from a SqlBuilder instance.
executeStatement ( $statement, $arguments )
explainStatement ( $statement, $arguments )
getColumns ( string $table ) : array(string) List the column names of a table alphabetically.
getTableDescriptor ( string $table ) : RecessTableDescriptor Retrieve the a table's RecessTableDescriptor.
getTables ( ) : array(string) List the tables in a data source alphabetically.
prepareStatement ( $statement, $arguments )
queryForClass ( SqlBuilder $builder, string $className ) : array($className) Takes the SQL and arguments (array of Criterion) and returns an array of objects of type $className.
select ( string $table = '' ) : PdoDataSet Begin a select operation by returning a new, unrealized PdoDataSet

Защищенные методы

Метод Описание
instantiateProvider ( ) : IPdoDataSourceProvider Locate the pdo driver specific data source provider, instantiate, and return.

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

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

The first argument can either be a string DSN or an array which contains the construction arguments.
public __construct ( mixed $dsn, string $username = '', string $password = '', array $driver_options = [] )
$dsn mixed String DSN or array of arguments (dsn, username, password)
$username string
$password string
$driver_options array

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

Take a table descriptor and apply it / verify it on top of the table descriptor returned from a database. This is used to ensure a model's marked up fields are in congruence with the table. Also checks to ensure the number of columns in the cascaded descriptor do not outnumber the actual number of columns. Finally with a database like sqlite which largely ignores column typing it enables the model to inform the actual Recess type of the column.
public cascadeTableDescriptor ( string $table, RecessTableDescriptor $descriptor )
$table string
$descriptor RecessTableDescriptor

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

public createTableSql ( $tableDescriptor )

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

Drop a table from the database.
public dropTable ( string $table )
$table string

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

Empty a table in the database.
public emptyTable ( string $table )
$table string

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

Execute the query from a SqlBuilder instance.
public executeSqlBuilder ( SqlBuilder $builder, string $action ) : boolean
$builder SqlBuilder
$action string
Результат boolean

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

public executeStatement ( $statement, $arguments )

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

public explainStatement ( $statement, $arguments )

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

List the column names of a table alphabetically.
public getColumns ( string $table ) : array(string)
$table string Table whose columns to list.
Результат array(string)

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

Retrieve the a table's RecessTableDescriptor.
public getTableDescriptor ( string $table ) : RecessTableDescriptor
$table string
Результат RecessTableDescriptor

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

List the tables in a data source alphabetically.
public getTables ( ) : array(string)
Результат array(string)

instantiateProvider() защищенный Метод

Throws ProviderDoesNotExistException for a pdo driver without a Recess provider.
protected instantiateProvider ( ) : IPdoDataSourceProvider
Результат IPdoDataSourceProvider

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

public prepareStatement ( $statement, $arguments )

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

Takes the SQL and arguments (array of Criterion) and returns an array of objects of type $className.
public queryForClass ( SqlBuilder $builder, string $className ) : array($className)
$builder SqlBuilder
$className string the type to fill from query results.
Результат array($className)

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

Begin a select operation by returning a new, unrealized PdoDataSet
public select ( string $table = '' ) : PdoDataSet
$table string Optional parameter that sets the from clause of the select to a table.
Результат PdoDataSet

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

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

protected $cachePrefix

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

protected $provider