PHP Class MysqlDataSourceProvider, recess

Author: Kris Jordan ([email protected])
Inheritance: implements IPdoDataSourceProvider
显示文件 Open project: KrisJordan/recess Class Usage Examples

Protected Properties

Property Type Description
$mysqlToRecessMappings
$pdo
$recessToMysqlMappings

Public Methods

Method 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 method

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 method

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

dropTable() public method

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

emptyTable() public method

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

executeSqlBuilder() public method

public executeSqlBuilder ( SqlBuilder $builder, string $action, PdoDataSource $source ) : boolean
$builder SqlBuilder
$action string
$source PdoDataSource
return boolean

fetchAll() public method

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
return array fetchAll() of statement

getColumns() public method

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

getMysqlToRecessMappings() static public method

static public getMysqlToRecessMappings ( )

getRecessToMysqlMappings() static public method

static public getRecessToMysqlMappings ( )

getRecessType() public method

public getRecessType ( $mysqlType )

getStatementForBuilder() public method

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

getTableDescriptor() public method

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

getTables() public method

List the tables in a data source.
public getTables ( ) : array(string)
return array(string)

init() public method

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