PHP Class MysqlDataSourceProvider, recess

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

Protected Properties

Свойство Type Description
$mysqlToRecessMappings
$pdo
$recessToMysqlMappings

Méthodes publiques

Méthode Description
cascadeTableDescriptor ( string $table, RecessTableDescriptor $descriptor ) Sanity check and semantic sugar from higher level representation of table pushed down to the RDBMS representation of the table.
createTableSql ( RecessTableDescriptor $definition ) Given a Table Definition, return the CREATE TABLE SQL statement in the MySQL's syntax.
dropTable ( string $table ) Drop a table from MySql database.
emptyTable ( string $table ) Empty a table from MySql database.
executeSqlBuilder ( SqlBuilder $builder, string $action, PdoDataSource $source ) : boolean
fetchAll ( PDOStatement $statement ) : array Fetch all returns columns typed as Recess expects: i.e. Dates become Unix Time Based and TinyInts are converted to Boolean
getColumns ( string $table ) : array(string) List the column names of a table alphabetically.
getMysqlToRecessMappings ( )
getRecessToMysqlMappings ( )
getRecessType ( $mysqlType )
getStatementForBuilder ( SqlBuilder $builder, $action, PdoDataSource $source )
getTableDescriptor ( string $table ) : RecessTableDescriptor Retrieve the a table's RecessTableDescriptor.
getTables ( ) : array(string) List the tables in a data source.
init ( PDO $pdo ) Initialize with a reference back to the PDO object.

Method Details

cascadeTableDescriptor() public méthode

Sanity check and semantic sugar from higher level representation of table pushed down to the RDBMS representation of the table.
public cascadeTableDescriptor ( string $table, RecessTableDescriptor $descriptor )
$table string
$descriptor RecessTableDescriptor

createTableSql() public méthode

Given a Table Definition, return the CREATE TABLE SQL statement in the MySQL's syntax.
public createTableSql ( RecessTableDescriptor $definition )
$definition RecessTableDescriptor

dropTable() public méthode

Drop a table from MySql database.
public dropTable ( string $table )
$table string Name of table.

emptyTable() public méthode

Empty a table from MySql database.
public emptyTable ( string $table )
$table string Name of table.

executeSqlBuilder() public méthode

public executeSqlBuilder ( SqlBuilder $builder, string $action, PdoDataSource $source ) : boolean
$builder SqlBuilder
$action string
$source PdoDataSource
Résultat boolean

fetchAll() public méthode

TODO: Refactor this into the query code so that MySql does the type conversion instead of doing it slow and manually in PHP.
public fetchAll ( PDOStatement $statement ) : array
$statement PDOStatement
Résultat array fetchAll() of statement

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)

getMysqlToRecessMappings() static public méthode

static public getMysqlToRecessMappings ( )

getRecessToMysqlMappings() static public méthode

static public getRecessToMysqlMappings ( )

getRecessType() public méthode

public getRecessType ( $mysqlType )

getStatementForBuilder() public méthode

public getStatementForBuilder ( SqlBuilder $builder, $action, PdoDataSource $source )
$builder SqlBuilder
$source PdoDataSource

getTableDescriptor() public méthode

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

getTables() public méthode

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

init() public méthode

Initialize with a reference back to the PDO object.
public init ( PDO $pdo )
$pdo PDO

Property Details

$mysqlToRecessMappings protected_oe static_oe property

protected static $mysqlToRecessMappings

$pdo protected_oe property

protected $pdo

$recessToMysqlMappings protected_oe static_oe property

protected static $recessToMysqlMappings