PHP Класс BcSqlite

Наследование: extends Sqlite
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$columns array SQLite3 column definition
$description string ..
$endQuote string ..
$last_error
$pdo_statement
$row_count
$rows
$startQuote string ..

Защищенные свойства (Protected)

Свойство Тип Описание
$_baseConfig array Base configuration settings for SQLite3 driver

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
_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 テーブルからテーブルへデータを移動する

Приватные методы

Метод Описание
__describe ( Model $model ) : mixed Returns a Model description (metadata) or null if none found.

Описание методов

_alterIndexes() защищенный Метод

TODO 未サポート
protected _alterIndexes ( string $table, $indexes ) : array
$table string Table to alter indexes for
Результат array Index alteration statements

_convertCsvFieldsFromSchema() защищенный Метод

スキーマ情報よりCSV形式のフィールドリストを取得する
protected _convertCsvFieldsFromSchema ( array $schema ) : string
$schema array
Результат string

_execute() защищенный Метод

Executes given SQL statement.
protected _execute ( string $sql, $params = [], $prepareOptions = [] ) : resource
$sql string SQL statement
Результат resource Result resource identifier

_moveData() защищенный Метод

テーブルからテーブルへデータを移動する
protected _moveData ( string $sourceTableName, string $targetTableName, array $schema ) : booelan
$sourceTableName string
$targetTableName string
$schema array
Результат booelan

alterSchema() публичный Метод

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()
Результат array Array of alter statements to make.

alterTable() публичный Метод

テーブル構造を変更する
public alterTable ( array $options ) : boolean
$options array [ new / old ]
Результат boolean

begin() публичный Метод

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

buildColumn() публичный Метод

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'.
Результат string

buildIndex() публичный Метод

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
Результат string

buildRenameTable() публичный Метод

テーブル名のリネームステートメントを生成
public buildRenameTable ( string $sourceName, string $targetName ) : string
$sourceName string
$targetName string
Результат string

column() публичный Метод

Converts database-layer column types to basic types
public column ( string $real ) : string
$real string Real database-layer column type (i.e. "varchar(255)")
Результат string Abstract column type (i.e. "string")

commit() публичный Метод

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

connect() публичный Метод

Connects to the database using config['database'] as a filename.
public connect ( ) : mixed
Результат mixed

describe() публичный Метод

Returns an array of the fields in given table name.
public describe ( $model ) : array
Результат array Fields in table. Keys are name and type

disconnect() публичный Метод

Disconnects from database.
public disconnect ( ) : boolean
Результат boolean True if the database could be disconnected, else false

dropColumn() публичный Метод

カラムを削除する
public dropColumn ( array $options ) : boolean
$options array [ table / field / prefix ]
Результат boolean

fetchResult() публичный Метод

Fetches the next row from the current result set
public fetchResult ( ) : unknown
Результат unknown

hasResult() публичный Метод

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

index() публичный Метод

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
Результат array Fields in table. Keys are column and unique

lastAffected() публичный Метод

Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.
public lastAffected ( $source = null ) : integer
Результат integer Number of affected rows

lastError() публичный Метод

Returns a formatted error message from previous database operation.
public lastError ( PDOStatement $query = null ) : string
$query PDOStatement
Результат string Error message

lastInsertId() публичный Метод

Returns the ID generated from the previous INSERT operation.
public lastInsertId ( $source = null ) : integer
Результат integer

lastNumRows() публичный Метод

Returns number of rows in previous resultset. If no previous resultset exists, this returns false.
public lastNumRows ( $source = null ) : integer
Результат integer Number of rows in resultset

limit() публичный Метод

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
Результат string SQL limit/offset statement

listSources() публичный Метод

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
Результат array Array of tablenames in the database

renameColumn() публичный Метод

カラムを変更する
public renameColumn ( array $options ) : boolean
$options array [ table / new / old ]
Результат boolean

renderStatement() публичный Метод

Overrides DboSource::renderStatement to handle schema generation with SQLite3-style indexes
public renderStatement ( string $type, array $data ) : string
$type string
$data array
Результат string

resultSet() публичный Метод

Generate ResultSet
public resultSet ( mixed $results ) : void
$results mixed The results to modify.
Результат void

rollback() публичный Метод

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

update() публичный Метод

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
Результат array

value() публичный Метод

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
Результат string Quoted and escaped

Описание свойств

$_baseConfig защищенное свойство

Base configuration settings for SQLite3 driver
protected array $_baseConfig
Результат array

$columns публичное свойство

SQLite3 column definition
public array $columns
Результат array

$description публичное свойство

..
public string $description
Результат string

$endQuote публичное свойство

..
public string $endQuote
Результат string

$last_error публичное свойство

public $last_error

$pdo_statement публичное свойство

public $pdo_statement

$row_count публичное свойство

public $row_count

$rows публичное свойство

public $rows

$startQuote публичное свойство

..
public string $startQuote
Результат string