PHP Class Spot\Adapter\Sqlite

Inheritance: extends Spot\Adapter\PDO\BaseAbstract, implements Spot\Adapter\AdapterInterface
Afficher le fichier Open project: vlucas/spot

Protected Properties

Свойство Type Description
$_charset not supported
$_collate only UTF_8 supported
$_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

Méthodes publiques

Méthode Description
connection ( ) : object Get database connection
escapeField ( $field ) Escape/quote direct user input
migrate ( String $table, array $fields, array $options = [] ) Migrate table structure changes to database
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, array $options ) : string Syntax for CREATE TABLE with given fields and column syntax
migrateSyntaxTableUpdate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : string Syntax for ALTER TABLE with given fields and column syntax
truncateDatasource ( $datasource ) Truncate a database table Should delete all rows and reset serial/auto_increment keys to 0

Méthodes protégées

Méthode Description
getColumnsForTable ( String $table, string $source ) : Array Get columns for current table
shouldUpdateMigrateField ( $formattedField, $columnInfo )

Method Details

connection() public méthode

Get database connection
public connection ( ) : object
Résultat object PDO

escapeField() public méthode

Escape/quote direct user input
public escapeField ( $field )

getColumnsForTable() protected méthode

Get columns for current table
protected getColumnsForTable ( String $table, string $source ) : Array
$table String Table name
$source string
Résultat Array

migrate() public méthode

Migrate table structure changes to database
public migrate ( String $table, array $fields, array $options = [] )
$table String Table name
$fields array Fields and their attributes as defined in the mapper
$options array Options that may affect migrations or how tables are setup

migrateSyntaxFieldCreate() public méthode

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
Résultat string SQL syntax

migrateSyntaxFieldUpdate() public méthode

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
Résultat string SQL syntax

migrateSyntaxTableCreate() public méthode

Syntax for CREATE TABLE with given fields and column syntax
public migrateSyntaxTableCreate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : 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
$options array Options that may affect migrations or how tables are setup
Résultat string SQL syntax

migrateSyntaxTableUpdate() public méthode

Syntax for ALTER TABLE with given fields and column syntax
public migrateSyntaxTableUpdate ( string $table, array $formattedFields, array $columnsSyntax, array $options ) : 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
$options array
Résultat string SQL syntax

shouldUpdateMigrateField() protected méthode

protected shouldUpdateMigrateField ( $formattedField, $columnInfo )

truncateDatasource() public méthode

Truncate a database table Should delete all rows and reset serial/auto_increment keys to 0
public truncateDatasource ( $datasource )

Property Details

$_charset protected_oe property

not supported
protected $_charset

$_collate protected_oe property

only UTF_8 supported
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