PHP 클래스 BcSqlite

상속: extends Sqlite
파일 보기 프로젝트 열기: baserproject/basercms

공개 프로퍼티들

프로퍼티 타입 설명
$columns array SQLite3 column definition
$description string ..
$endQuote string ..
$last_error
$pdo_statement
$row_count
$rows
$startQuote string ..

보호된 프로퍼티들

프로퍼티 타입 설명
$_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