PHP Class BcSqlite

Inheritance: extends Sqlite
Afficher le fichier Open project: baserproject/basercms

Méthodes publiques

Свойство Type Description
$columns array SQLite3 column definition
$description string ..
$endQuote string ..
$last_error
$pdo_statement
$row_count
$rows
$startQuote string ..

Protected Properties

Свойство Type Description
$_baseConfig array Base configuration settings for SQLite3 driver

Méthodes publiques

Méthode Description
alterSchema ( array $compare, $table = null ) : array Generate a MySQL Alter Table syntax for the given Schema comparison
alterTable ( array $options ) : boolean テーブル構造を変更する
begin ( ) : boolean Begin a transaction TODO データベースがロックされてしまい正常に処理が実行されないのでとりあえず未実装とする ロックに関する原因については未解析
buildColumn ( array $column ) : string Generate a database-native column schema string
buildIndex ( array $indexes, string $table = null ) : string Removes redundant primary key indexes, as they are handled in the column def of the key.
buildRenameTable ( string $sourceName, string $targetName ) : string テーブル名のリネームステートメントを生成
column ( string $real ) : string Converts database-layer column types to basic types
commit ( ) : boolean Commit a transaction TODO データベースがロックされてしまい正常に処理が実行されないのでとりあえず未実装とする ロックに関する原因については未解析
connect ( ) : mixed Connects to the database using config['database'] as a filename.
describe ( $model ) : array Returns an array of the fields in given table name.
disconnect ( ) : boolean Disconnects from database.
dropColumn ( array $options ) : boolean カラムを削除する
fetchResult ( ) : unknown Fetches the next row from the current result set
hasResult ( ) PDO deals in objects, not resources, so overload accordingly.
index ( string $model ) : array Overrides DboSource::index to handle SQLite indexe introspection Returns an array of the indexes in given table name.
lastAffected ( $source = null ) : integer Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.
lastError ( PDOStatement $query = null ) : string Returns a formatted error message from previous database operation.
lastInsertId ( $source = null ) : integer Returns the ID generated from the previous INSERT operation.
lastNumRows ( $source = null ) : integer Returns number of rows in previous resultset. If no previous resultset exists, this returns false.
limit ( integer $limit, integer $offset = null ) : string Returns a limit statement in the correct format for the particular database.
listSources ( $data = null ) : array Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.
renameColumn ( array $options ) : boolean カラムを変更する
renderStatement ( string $type, array $data ) : string Overrides DboSource::renderStatement to handle schema generation with SQLite3-style indexes
resultSet ( mixed $results ) : void Generate ResultSet
rollback ( ) : boolean Rollback a transaction TODO データベースがロックされてしまい正常に処理が実行されないのでとりあえず未実装とする ロックに関する原因については未解析
update ( Model $model, array $fields = null, array $values = null, mixed $conditions = null ) : array Generates and executes an SQL UPDATE statement for given model, fields, and values.
value ( string $data, string $column = null, integer $safe = false ) : string Returns a quoted and escaped string of $data for use in an SQL statement.

Méthodes protégées

Méthode Description
_alterIndexes ( string $table, $indexes ) : array Generate index alteration statements for a table.
_convertCsvFieldsFromSchema ( array $schema ) : string スキーマ情報よりCSV形式のフィールドリストを取得する
_execute ( string $sql, $params = [], $prepareOptions = [] ) : resource Executes given SQL statement.
_moveData ( string $sourceTableName, string $targetTableName, array $schema ) : booelan テーブルからテーブルへデータを移動する

Private Methods

Méthode Description
__describe ( Model $model ) : mixed Returns a Model description (metadata) or null if none found.

Method Details

_alterIndexes() protected méthode

TODO 未サポート
protected _alterIndexes ( string $table, $indexes ) : array
$table string Table to alter indexes for
Résultat array Index alteration statements

_convertCsvFieldsFromSchema() protected méthode

スキーマ情報よりCSV形式のフィールドリストを取得する
protected _convertCsvFieldsFromSchema ( array $schema ) : string
$schema array
Résultat string

_execute() protected méthode

Executes given SQL statement.
protected _execute ( string $sql, $params = [], $prepareOptions = [] ) : resource
$sql string SQL statement
Résultat resource Result resource identifier

_moveData() protected méthode

テーブルからテーブルへデータを移動する
protected _moveData ( string $sourceTableName, string $targetTableName, array $schema ) : booelan
$sourceTableName string
$targetTableName string
$schema array
Résultat booelan

alterSchema() public méthode

Generate a MySQL Alter Table syntax for the given Schema comparison
public alterSchema ( array $compare, $table = null ) : array
$compare array Result of a CakeSchema::compare()
Résultat array Array of alter statements to make.

alterTable() public méthode

テーブル構造を変更する
public alterTable ( array $options ) : boolean
$options array [ new / old ]
Résultat boolean

begin() public méthode

Begin a transaction TODO データベースがロックされてしまい正常に処理が実行されないのでとりあえず未実装とする ロックに関する原因については未解析
public begin ( ) : boolean
Résultat boolean True on success, false on fail (i.e. if the database/model does not support transactions).

buildColumn() public méthode

Generate a database-native column schema string
public buildColumn ( array $column ) : string
$column array An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]), where options can be 'default', 'length', or 'key'.
Résultat string

buildIndex() public méthode

Removes redundant primary key indexes, as they are handled in the column def of the key.
public buildIndex ( array $indexes, string $table = null ) : string
$indexes array
$table string
Résultat string

buildRenameTable() public méthode

テーブル名のリネームステートメントを生成
public buildRenameTable ( string $sourceName, string $targetName ) : string
$sourceName string
$targetName string
Résultat string

column() public méthode

Converts database-layer column types to basic types
public column ( string $real ) : string
$real string Real database-layer column type (i.e. "varchar(255)")
Résultat string Abstract column type (i.e. "string")

commit() public méthode

Commit a transaction TODO データベースがロックされてしまい正常に処理が実行されないのでとりあえず未実装とする ロックに関する原因については未解析
public commit ( ) : boolean
Résultat boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

connect() public méthode

Connects to the database using config['database'] as a filename.
public connect ( ) : mixed
Résultat mixed

describe() public méthode

Returns an array of the fields in given table name.
public describe ( $model ) : array
Résultat array Fields in table. Keys are name and type

disconnect() public méthode

Disconnects from database.
public disconnect ( ) : boolean
Résultat boolean True if the database could be disconnected, else false

dropColumn() public méthode

カラムを削除する
public dropColumn ( array $options ) : boolean
$options array [ table / field / prefix ]
Résultat boolean

fetchResult() public méthode

Fetches the next row from the current result set
public fetchResult ( ) : unknown
Résultat unknown

hasResult() public méthode

PDO deals in objects, not resources, so overload accordingly.
public hasResult ( )

index() public méthode

Overrides DboSource::index to handle SQLite indexe introspection Returns an array of the indexes in given table name.
public index ( string $model ) : array
$model string Name of model to inspect
Résultat array Fields in table. Keys are column and unique

lastAffected() public méthode

Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.
public lastAffected ( $source = null ) : integer
Résultat integer Number of affected rows

lastError() public méthode

Returns a formatted error message from previous database operation.
public lastError ( PDOStatement $query = null ) : string
$query PDOStatement
Résultat string Error message

lastInsertId() public méthode

Returns the ID generated from the previous INSERT operation.
public lastInsertId ( $source = null ) : integer
Résultat integer

lastNumRows() public méthode

Returns number of rows in previous resultset. If no previous resultset exists, this returns false.
public lastNumRows ( $source = null ) : integer
Résultat integer Number of rows in resultset

limit() public méthode

Returns a limit statement in the correct format for the particular database.
public limit ( integer $limit, integer $offset = null ) : string
$limit integer Limit of results returned
$offset integer Offset from which to start results
Résultat string SQL limit/offset statement

listSources() public méthode

Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.
public listSources ( $data = null ) : array
Résultat array Array of tablenames in the database

renameColumn() public méthode

カラムを変更する
public renameColumn ( array $options ) : boolean
$options array [ table / new / old ]
Résultat boolean

renderStatement() public méthode

Overrides DboSource::renderStatement to handle schema generation with SQLite3-style indexes
public renderStatement ( string $type, array $data ) : string
$type string
$data array
Résultat string

resultSet() public méthode

Generate ResultSet
public resultSet ( mixed $results ) : void
$results mixed The results to modify.
Résultat void

rollback() public méthode

Rollback a transaction TODO データベースがロックされてしまい正常に処理が実行されないのでとりあえず未実装とする ロックに関する原因については未解析
public rollback ( ) : boolean
Résultat boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

update() public méthode

Generates and executes an SQL UPDATE statement for given model, fields, and values.
public update ( Model $model, array $fields = null, array $values = null, mixed $conditions = null ) : array
$model Model
$fields array
$values array
$conditions mixed
Résultat array

value() public méthode

Returns a quoted and escaped string of $data for use in an SQL statement.
public value ( string $data, string $column = null, integer $safe = false ) : string
$data string String to be prepared for use in an SQL statement
$column string
$safe integer
Résultat string Quoted and escaped

Property Details

$_baseConfig protected_oe property

Base configuration settings for SQLite3 driver
protected array $_baseConfig
Résultat array

$columns public_oe property

SQLite3 column definition
public array $columns
Résultat array

$description public_oe property

..
public string $description
Résultat string

$endQuote public_oe property

..
public string $endQuote
Résultat string

$last_error public_oe property

public $last_error

$pdo_statement public_oe property

public $pdo_statement

$row_count public_oe property

public $row_count

$rows public_oe property

public $rows

$startQuote public_oe property

..
public string $startQuote
Résultat string