PHP Class phpDataMapper_Adapter_Mysql, phpDataMapper

Inheritance: extends phpDataMapper_Adapter_PDO
Exibir arquivo Open project: vlucas/phpDataMapper

Protected Properties

Property Type Description
$_charset
$_collate
$_engine Driver-Specific settings
$_fieldTypeMap @todo Have to improve this to allow custom types, callbacks, and validation
$format_date Format for date columns, formatted for PHP's date() function
$format_datetime
$format_time

Public Methods

Method Description
characterSet ( $charset, $collate = 'utf8_unicode_ci' ) Set character set and MySQL collate string
dsn ( ) : string Get DSN string for PDO to connect with
engine ( $engine = null ) Set database engine (InnoDB, MyISAM, etc)
migrateSyntaxFieldCreate ( string $fieldName, array $fieldInfo ) : string Syntax for each column in CREATE TABLE command
migrateSyntaxFieldUpdate ( string $fieldName, array $fieldInfo, $add = false ) : string Syntax for each column in CREATE TABLE command
migrateSyntaxTableCreate ( string $table, array $formattedFields, array $columnsSyntax ) : string Syntax for CREATE TABLE with given fields and column syntax
migrateSyntaxTableUpdate ( string $table, array $formattedFields, array $columnsSyntax ) : string Syntax for ALTER TABLE with given fields and column syntax

Protected Methods

Method Description
getColumnsForTable ( String $table, $source ) : Array Get columns for current table

Method Details

characterSet() public method

Set character set and MySQL collate string
public characterSet ( $charset, $collate = 'utf8_unicode_ci' )

dsn() public method

Get DSN string for PDO to connect with
public dsn ( ) : string
return string

engine() public method

Set database engine (InnoDB, MyISAM, etc)
public engine ( $engine = null )

getColumnsForTable() protected method

Get columns for current table
protected getColumnsForTable ( String $table, $source ) : Array
$table String Table name
return Array

migrateSyntaxFieldCreate() public method

Syntax for each column in CREATE TABLE command
public migrateSyntaxFieldCreate ( string $fieldName, array $fieldInfo ) : string
$fieldName string Field name
$fieldInfo array Array of field settings
return string SQL syntax

migrateSyntaxFieldUpdate() public method

Syntax for each column in CREATE TABLE command
public migrateSyntaxFieldUpdate ( string $fieldName, array $fieldInfo, $add = false ) : string
$fieldName string Field name
$fieldInfo array Array of field settings
return string SQL syntax

migrateSyntaxTableCreate() public method

Syntax for CREATE TABLE with given fields and column syntax
public migrateSyntaxTableCreate ( string $table, array $formattedFields, array $columnsSyntax ) : string
$table string Table name
$formattedFields array Array of fields with all settings
$columnsSyntax array Array of SQL syntax of columns produced by 'migrateSyntaxFieldCreate' function
return string SQL syntax

migrateSyntaxTableUpdate() public method

Syntax for ALTER TABLE with given fields and column syntax
public migrateSyntaxTableUpdate ( string $table, array $formattedFields, array $columnsSyntax ) : string
$table string Table name
$formattedFields array Array of fields with all settings
$columnsSyntax array Array of SQL syntax of columns produced by 'migrateSyntaxFieldUpdate' function
return string SQL syntax

Property Details

$_charset protected_oe property

protected $_charset

$_collate protected_oe property

protected $_collate

$_engine protected_oe property

Driver-Specific settings
protected $_engine

$_fieldTypeMap protected_oe property

@todo Have to improve this to allow custom types, callbacks, and validation
protected $_fieldTypeMap

$format_date protected_oe property

Format for date columns, formatted for PHP's date() function
protected $format_date

$format_datetime protected_oe property

protected $format_datetime

$format_time protected_oe property

protected $format_time