a-blog cms PHP API Reference

Database extends Facade
in package

Table of Contents

Properties

$container  : Container
$instance  : mixed

Methods

__callStatic()  : mixed
affected_rows()  : int
charset()  : string
checkConnectDatabase()  : bool
checkConnection()  : bool
columnCount()  : int
columnMeta()  : array<string|int, mixed>
connect()  : Base
connection()  : mixed
errorCode()  : string
errorInfo()  : array<string|int, mixed>
fetch()  : mixed
getInstance()  : mixed
get service instance
getThrowException()  : bool
getVersion()  : string
hook()  : void
isFetched()  : bool
next()  : mixed
optimizeTable()  : void
persistent()  : Base
query()  : mixed
quote()  : string
reconnect()  : Base
setContainer()  : void
setThrowException()  : void
singleton()  : Base
subQuery()  : SQL|mixed
time()  : array<string|int, mixed>|int|void
getServiceAlias()  : string
getServiceInstance()  : mixed
isCache()  : bool

Properties

$instance

protected static mixed $instance

Methods

__callStatic()

public static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<string|int, mixed>

affected_rows()

public static affected_rows() : int

影響を受けた行数取得

Return values
int

charset()

public static charset() : string

文字コード取得

Return values
string

checkConnectDatabase()

public static checkConnectDatabase(array<string|int, mixed> $dsn) : bool

データベースへの接続チェック

Parameters
$dsn : array<string|int, mixed>
Return values
bool

checkConnection()

public static checkConnection(array<string|int, mixed> $dsn) : bool

データベースサーバーへの接続チェック

Parameters
$dsn : array<string|int, mixed>
Return values
bool

columnCount()

public static columnCount() : int

カラム数取得

Return values
int

columnMeta()

public static columnMeta(int $column) : array<string|int, mixed>

カラムメタデータ取得

Parameters
$column : int
Return values
array<string|int, mixed>

connect()

public static connect(array<string|int, mixed> $dsn) : Base

データベース接続

Parameters
$dsn : array<string|int, mixed>
Return values
Base

connection()

public static connection() : mixed

データベース接続オブジェクト取得

errorCode()

public static errorCode() : string

エラーコード取得

Return values
string

errorInfo()

public static errorInfo() : array<string|int, mixed>

エラー情報取得

Return values
array<string|int, mixed>

fetch()

public static fetch([array{sql: string, params: list|array}|null $sql = = 'null' ][, bool $reset = = 'false' ]) : mixed

クエリ結果取得

Parameters
$sql : array{sql: string, params: list|array}|null = = 'null'
$reset : bool = = 'false'

getInstance()

get service instance

public static getInstance() : mixed

getThrowException()

public static getThrowException() : bool

例外をスローするかの設定を取得

Return values
bool

getVersion()

public static getVersion() : string

データベースバージョン取得

Return values
string

hook()

public static hook(mixed &$sql) : void

クエリ書き換え用Hook

Parameters
$sql : mixed

isFetched()

public static isFetched([array{sql: string, params: list|array}|null $sql = = 'null' ]) : bool

クエリがフェッチ済みかどうか

Parameters
$sql : array{sql: string, params: list|array}|null = = 'null'
Return values
bool

next()

public static next(PDOStatement $response) : mixed

クエリ結果取得

Parameters
$response : PDOStatement

optimizeTable()

public static optimizeTable() : void

テーブル最適化

persistent()

public static persistent([array<string|int, mixed>|null $dsn = = 'null' ]) : Base

持続接続

Parameters
$dsn : array<string|int, mixed>|null = = 'null'
Return values
Base

query()

public static query(array{sql: string, params: list|array}|string $query[, string $mode = = '\'row\'' ]) : mixed

クエリ実行

Parameters
$query : array{sql: string, params: list|array}|string
$mode : string = = '\'row\''

quote()

public static quote(string $string) : string

クオート処理

Parameters
$string : string
Return values
string

reconnect()

public static reconnect(array<string|int, mixed> $dsn) : Base

データベース再接続

Parameters
$dsn : array<string|int, mixed>
Return values
Base

setThrowException()

public static setThrowException(bool $throw) : void

例外をスローするか設定

Parameters
$throw : bool

singleton()

public static singleton([array<string|int, mixed>|null $dsn = = 'null' ]) : Base

データベースエンジンインスタンス取得

Parameters
$dsn : array<string|int, mixed>|null = = 'null'
Return values
Base

subQuery()

public static subQuery(SQL $query[, bool $subquery = = 'false' ]) : SQL|mixed

バージョンによって、サブクエリを使用するか分離するかを判断

Parameters
$query : SQL
$subquery : bool = = 'false'
Return values
SQL|mixed

time()

public static time([string|null $sql = = 'null' ][, int|null $time = = 'null' ]) : array<string|int, mixed>|int|void

処理時間保存

Parameters
$sql : string|null = = 'null'
$time : int|null = = 'null'
Return values
array<string|int, mixed>|int|void

getServiceAlias()

protected static getServiceAlias() : string
Return values
string

getServiceInstance()

protected static getServiceInstance(string $alias) : mixed
Parameters
$alias : string

isCache()

protected static isCache() : bool
Return values
bool

        
On this page

Search results