\BEAR_Mdb2

MDB2

PEAR::MDB2を生成、設定してインスタンスを返すMDB2のファクトリークラスです。

MDB2結果コード

('MDB2_OK',                      true);
('MDB2_ERROR',                     -1);
('MDB2_ERROR_SYNTAX',              -2);
('MDB2_ERROR_CONSTRAINT',          -3);
('MDB2_ERROR_NOT_FOUND',           -4);
('MDB2_ERROR_ALREADY_EXISTS',      -5);
('MDB2_ERROR_UNSUPPORTED',         -6);
('MDB2_ERROR_MISMATCH',            -7);
('MDB2_ERROR_INVALID',             -8);
('MDB2_ERROR_NOT_CAPABLE',         -9);
('MDB2_ERROR_TRUNCATED',          -10);
('MDB2_ERROR_INVALID_NUMBER',     -11);
('MDB2_ERROR_INVALID_DATE',       -12);
('MDB2_ERROR_DIVZERO',            -13);
('MDB2_ERROR_NODBSELECTED',       -14);
('MDB2_ERROR_CANNOT_CREATE',      -15);
('MDB2_ERROR_CANNOT_DELETE',      -16);
('MDB2_ERROR_CANNOT_DROP',        -17);
('MDB2_ERROR_NOSUCHTABLE',        -18);
('MDB2_ERROR_NOSUCHFIELD',        -19);
('MDB2_ERROR_NEED_MORE_DATA',     -20);
('MDB2_ERROR_NOT_LOCKED',         -21);
('MDB2_ERROR_VALUE_COUNT_ON_ROW', -22);
('MDB2_ERROR_INVALID_DSN',        -23);
('MDB2_ERROR_CONNECT_FAILED',     -24);
('MDB2_ERROR_EXTENSION_NOT_FOUND',-25);
('MDB2_ERROR_NOSUCHDB',           -26);
('MDB2_ERROR_ACCESS_VIOLATION',   -27);
('MDB2_ERROR_CANNOT_REPLACE',     -28);
('MDB2_ERROR_CONSTRAINT_NOT_NULL',-29);
('MDB2_ERROR_DEADLOCK',           -30);
('MDB2_ERROR_CANNOT_ALTER',       -31);
('MDB2_ERROR_MANAGER',            -32);
('MDB2_ERROR_MANAGER_PARSE',      -33);
('MDB2_ERROR_LOADMODULE',         -34);
('MDB2_ERROR_INSUFFICIENT_DATA',  -35);

DATAタイプ

'text':
'clob':
'blob':
'integer':
'boolean':
'date':
'time':
'timestamp':
'float':
'decimal':

MDB2オプション
  • $options['ssl'] -> boolean: determines if ssl should be used for connections
  • $options['field_case'] -> CASE_LOWER|CASE_UPPER: determines what case to force on field/table names
  • $options['disable_query'] -> boolean: determines if queries should be executed
  • $options['result_class'] -> string: class used for result sets
  • $options['buffered_result_class'] -> string: class used for buffered result sets
  • $options['result_wrap_class'] -> string: class used to wrap result sets into
  • $options['result_buffering'] -> boolean should results be buffered or not?
  • $options['fetch_class'] -> string: class to use when fetch mode object is used
  • $options['persistent'] -> boolean: persistent connection?
  • $options['debug'] -> integer: numeric debug level
  • $options['debug_handler'] -> string: function/method that captures debug messages
  • $options['debug_expanded_output'] -> bool: BC option to determine if more context information should be send to the debug handler
  • $options['default_text_field_length'] -> integer: default text field length to use
  • $options['lob_buffer_length'] -> integer: LOB buffer length
  • $options['log_line_break'] -> string: line-break format
  • $options['idxname_format'] -> string: pattern for index name
  • $options['seqname_format'] -> string: pattern for sequence name
  • $options['savepoint_format'] -> string: pattern for auto generated savepoint names
  • $options['statement_format'] -> string: pattern for prepared statement names
  • $options['seqcol_name'] -> string: sequence column name
  • $options['quote_identifier'] -> boolean: if identifier quoting should be done when check_option is used
  • $options['use_transactions'] -> boolean: if transaction use should be enabled
  • $options['decimal_places'] -> integer: number of decimal places to handle
  • $options['portability'] -> integer: portability constant
  • $options['modules'] -> array: short to long module name mapping for __call()
  • $options['emulate_prepared'] -> boolean: force prepared statements to be emulated
  • $options['datatype_map'] -> array: map user defined datatypes to other primitive datatypes
  • $options['datatype_map_callback'] -> array: callback function/method that should be called
  • $options['bindname_format'] -> string: regular expression pattern for named parameters
  • $options['multi_query'] -> boolean: determines if queries returning multiple result sets should be executed
  • $options['max_identifiers_length'] -> integer: max identifier length
  • $options['default_fk_action_onupdate'] -> string: default FOREIGN KEY ON UPDATE action ['RESTRICT'|'NO ACTION'|'SET DEFAULT'|'SET NULL'|'CASCADE']
  • $options['default_fk_action_ondelete'] -> string: default FOREIGN KEY ON DELETE action ['RESTRICT'|'NO ACTION'|'SET DEFAULT'|'SET NULL'|'CASCADE']

Summary

Methods
Properties
Constants
factory()
__construct()
onInject()
setConfig()
getConfig()
setService()
onDebug()
No public properties found
No constants found
_exception()
$_config
N/A
No private methods found
$_lastLog
N/A

Properties

$_config

$_config : array

Class config

Type

array

$_lastLog

$_lastLog : array

Las log

Type

array

Methods

factory()

factory() : \MDB2_Driver_Datatype_mysqli

ファクトリー

MDB2を生成して設定(エラーハンドラーの設定やフェッチモードをASSOC)しています。 $dsnを省略すればApp_DB::$config['db']['default']がDSNとして利用されます。

Throws

\BEAR_Mdb2_Exception

Returns

\MDB2_Driver_Datatype_mysqli

__construct()

__construct(array  $config) 

Constructor

Parameters

array $config

onInject()

onInject() : void

Inject

設定にしたがってサービスをインジェクトします。

setConfig()

setConfig(mixed  $config, mixed  $values = null) : self

Set config

Parameters

mixed $config

(string) 設定キー | (array) 設定配列

mixed $values

(string) $configの時の設定値

Returns

self

getConfig()

getConfig(string  $key = null) : mixed

Get config

Parameters

string $key

設定キー、指定なければ全ての設定を取得

Returns

mixed

setService()

setService(string  $name, mixed  $service) : void

Set service

Parameters

string $name

サービスキー

mixed $service

サービス

onDebug()

onDebug(  $db, string  $scope, string  $message, boolean  $isManip = null) : void

デバック用ハンドラ

Parameters

$db
string $scope

スコープ

string $message

メッセージ

boolean $isManip

不明

_exception()

_exception(string  $msg, array  $config = array()) : \BEAR_Exception

例外の作成

Parameters

string $msg

例外メッセージ

array $config

例外config

Returns

\BEAR_Exception