PHP Class PdoDataSource, recess

Author: Kris Jordan ([email protected])
Inheritance: extends PDO
Afficher le fichier Open project: KrisJordan/recess Class Usage Examples

Protected Properties

Свойство Type Description
$cachePrefix
$provider

Méthodes publiques

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

Méthodes protégées

Méthode Description
instantiateProvider ( ) : IPdoDataSourceProvider Locate the pdo driver specific data source provider, instantiate, and return.

Method Details

__construct() public méthode

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() public méthode

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 méthode

public createTableSql ( $tableDescriptor )

dropTable() public méthode

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

emptyTable() public méthode

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

executeSqlBuilder() public méthode

Execute the query from a SqlBuilder instance.
public executeSqlBuilder ( SqlBuilder $builder, string $action ) : boolean
$builder SqlBuilder
$action string
Résultat boolean

executeStatement() public méthode

public executeStatement ( $statement, $arguments )

explainStatement() public méthode

public explainStatement ( $statement, $arguments )

getColumns() public méthode

List the column names of a table alphabetically.
public getColumns ( string $table ) : array(string)
$table string Table whose columns to list.
Résultat array(string)

getTableDescriptor() public méthode

Retrieve the a table's RecessTableDescriptor.
public getTableDescriptor ( string $table ) : RecessTableDescriptor
$table string
Résultat RecessTableDescriptor

getTables() public méthode

List the tables in a data source alphabetically.
public getTables ( ) : array(string)
Résultat array(string)

instantiateProvider() protected méthode

Throws ProviderDoesNotExistException for a pdo driver without a Recess provider.
protected instantiateProvider ( ) : IPdoDataSourceProvider
Résultat IPdoDataSourceProvider

prepareStatement() public méthode

public prepareStatement ( $statement, $arguments )

queryForClass() public méthode

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.
Résultat array($className)

select() public méthode

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.
Résultat PdoDataSet

Property Details

$cachePrefix protected_oe property

protected $cachePrefix

$provider protected_oe property

protected $provider