EC-CUBE
Public メソッド | 変数
クラス MDB2_Driver_Datatype_Common
MDB2_Driver_Datatype_Commonに対する継承グラフ
Inheritance graph
[凡例]
MDB2_Driver_Datatype_Commonのコラボレーション図
Collaboration graph
[凡例]

Public メソッド

 getValidTypes ()
 checkResultTypes ($types)
 _baseConvertResult ($value, $type, $rtrim=true)
 convertResult ($value, $type, $rtrim=true)
 convertResultRow ($types, $row, $rtrim=true)
 _sortResultFieldTypes ($columns, $types)
 getDeclaration ($type, $name, $field)
 getTypeDeclaration ($field)
 _getDeclaration ($name, $field)
 _getDeclarationOptions ($field)
 _getCharsetFieldDeclaration ($charset)
 _getCollationFieldDeclaration ($collation)
 _getIntegerDeclaration ($name, $field)
 _getTextDeclaration ($name, $field)
 _getCLOBDeclaration ($name, $field)
 _getBLOBDeclaration ($name, $field)
 _getBooleanDeclaration ($name, $field)
 _getDateDeclaration ($name, $field)
 _getTimestampDeclaration ($name, $field)
 _getTimeDeclaration ($name, $field)
 _getFloatDeclaration ($name, $field)
 _getDecimalDeclaration ($name, $field)
 compareDefinition ($current, $previous)
 _compareIntegerDefinition ($current, $previous)
 _compareTextDefinition ($current, $previous)
 _compareCLOBDefinition ($current, $previous)
 _compareBLOBDefinition ($current, $previous)
 _compareDateDefinition ($current, $previous)
 _compareTimeDefinition ($current, $previous)
 _compareTimestampDefinition ($current, $previous)
 _compareBooleanDefinition ($current, $previous)
 _compareFloatDefinition ($current, $previous)
 _compareDecimalDefinition ($current, $previous)
 quote ($value, $type=null, $quote=true, $escape_wildcards=false)
 _quoteInteger ($value, $quote, $escape_wildcards)
 _quoteText ($value, $quote, $escape_wildcards)
 _readFile ($value)
 _quoteLOB ($value, $quote, $escape_wildcards)
 _quoteCLOB ($value, $quote, $escape_wildcards)
 _quoteBLOB ($value, $quote, $escape_wildcards)
 _quoteBoolean ($value, $quote, $escape_wildcards)
 _quoteDate ($value, $quote, $escape_wildcards)
 _quoteTimestamp ($value, $quote, $escape_wildcards)
 _quoteTime ($value, $quote, $escape_wildcards)
 _quoteFloat ($value, $quote, $escape_wildcards)
 _quoteDecimal ($value, $quote, $escape_wildcards)
 writeLOBToFile ($lob, $file)
 _retrieveLOB (&$lob)
 _readLOB ($lob, $length)
 _endOfLOB ($lob)
 destroyLOB ($lob)
 _destroyLOB (&$lob)
 implodeArray ($array, $type=false)
 matchPattern ($pattern, $operator=null, $field=null)
 patternEscapeString ()
 mapNativeDatatype ($field)
 _mapNativeDatatype ($field)
 mapPrepareDatatype ($type)

変数

 $valid_default_values
 $lobs = array()

関数

_baseConvertResult ( value,
type,
rtrim = true 
)

General type conversion method

引数:
mixed$valuereference to a value to be converted
string$typespecifies which type to convert to
boolean$rtrim[optional] when TRUE [default], apply rtrim() to text
戻り値:
object an MDB2 error on failure protected

MDB2_Driver_Datatype_pgsqlで再定義されています。

_compareBLOBDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an BLOB field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareBooleanDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an boolean field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareCLOBDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an CLOB field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareDateDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an date field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareDecimalDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an decimal field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareFloatDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an float field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareIntegerDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an integer field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareTextDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an text field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareTimeDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an time field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_compareTimestampDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied to an timestamp field

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied protected
_destroyLOB ( &$  lob)

Free any resources allocated during the lifetime of the large object handler object.

引数:
array$lobarray private
_endOfLOB ( lob)

Determine whether it was reached the end of the large object and therefore there is no more data to be read for the its input stream.

引数:
array$lobarray
戻り値:
mixed true or false on success, a MDB2 error on failure protected
_getBLOBDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare an binary large object type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

length Integer value that determines the maximum length of the large object field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected
_getBooleanDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a boolean type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Boolean value to be used as default for this field.

notnullL Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected

Obtain DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration to be used in statements like CREATE TABLE.

引数:
string$charsetname of the charset
戻り値:
string DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration.

MDB2_Driver_Datatype_mysqlで再定義されています。

_getCLOBDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare an character large object type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

length Integer value that determines the maximum length of the large object field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. public

Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.

引数:
string$collationname of the collation
戻り値:
string DBMS specific SQL code portion needed to set the COLLATION of a field declaration.

MDB2_Driver_Datatype_mysqlで再定義されています。

_getDateDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a date type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Date value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected
_getDecimalDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a decimal type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Decimal value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected

MDB2_Driver_Datatype_mysqlで再定義されています。

_getDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS.

default Text value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field, or a MDB2_Error on failure protected
_getDeclarationOptions ( field)

Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statement like CREATE TABLE, without the field name and type values (ie. just the character set, default value, if the field is permitted to be NULL or not, and the collation options).

引数:
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Text value to be used as default for this field. notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field's options. protected
_getFloatDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a float type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Float value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected

MDB2_Driver_Datatype_mysqlで再定義されています。

_getIntegerDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare an integer type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

unsigned Boolean flag that indicates whether the field should be declared as unsigned integer if possible.

default Integer value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected

MDB2_Driver_Datatype_mysql, と MDB2_Driver_Datatype_pgsqlで再定義されています。

_getTextDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare an text type field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS.

default Text value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected
_getTimeDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a time field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Time value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected
_getTimestampDeclaration ( name,
field 
)

Obtain DBMS specific SQL code portion needed to declare a timestamp field to be used in statements like CREATE TABLE.

引数:
string$namename the field to be declared.
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

default Timestamp value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. protected
_mapNativeDatatype ( field)

Maps a native array description of a field to a MDB2 datatype and length

引数:
array$fieldnative field description
戻り値:
array containing the various possible types, length, sign, fixed public

MDB2_Driver_Datatype_mysql, と MDB2_Driver_Datatype_pgsqlで再定義されています。

_quoteBLOB ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected

MDB2_Driver_Datatype_pgsqlで再定義されています。

_quoteBoolean ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected

MDB2_Driver_Datatype_pgsqlで再定義されています。

_quoteCLOB ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected

MDB2_Driver_Datatype_pgsqlで再定義されています。

_quoteDate ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_quoteDecimal ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_quoteFloat ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_quoteInteger ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_quoteLOB ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_quoteText ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that already contains any DBMS specific escaped character sequences. protected
_quoteTime ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_quoteTimestamp ( value,
quote,
escape_wildcards 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_readFile ( value)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
戻り値:
string text string that represents the given argument value in a DBMS specific format. protected
_readLOB ( lob,
length 
)

Read data from large object input stream.

引数:
resource$lobstream handle
string$datareference to a variable that will hold data to be read from the large object input stream
integer$lengthvalue that indicates the largest ammount ofdata to be read from the large object input stream.
戻り値:
mixed the effective number of bytes read from the large object input stream on sucess or an MDB2 error object. public
参照:
endOfLOB()
_retrieveLOB ( &$  lob)

retrieve LOB from the database

引数:
array$lobarray
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure protected
_sortResultFieldTypes ( columns,
types 
)

convert a result row

引数:
array$types
array$rowspecifies the types to convert to
bool$rtrimif to rtrim text values or not
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public
checkResultTypes ( types)

Define the list of types to be associated with the columns of a given result set.

This function may be called before invoking fetchRow(), fetchOne() fetchCole() and fetchAll() so that the necessary data type conversions are performed on the data to be retrieved by them. If this function is not called, the type of all result set columns is assumed to be text, thus leading to not perform any conversions.

引数:
array$typesarray variable that lists the data types to be expected in the result set columns. If this array contains less types than the number of columns that are returned in the result set, the remaining columns are assumed to be of the type text. Currently, the types clob and blob are not fully supported.
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure public
compareDefinition ( current,
previous 
)

Obtain an array of changes that may need to applied

引数:
array$currentnew definition
array$previousold definition
戻り値:
array containing all changes that will need to be applied public
convertResult ( value,
type,
rtrim = true 
)

Convert a value to a RDBMS indipendent MDB2 type

引数:
mixed$valuevalue to be converted
string$typespecifies which type to convert to
boolean$rtrim[optional] when TRUE [default], apply rtrim() to text
戻り値:
mixed converted value public
convertResultRow ( types,
row,
rtrim = true 
)

Convert a result row

引数:
array$types
array$rowspecifies the types to convert to
boolean$rtrim[optional] when TRUE [default], apply rtrim() to text
戻り値:
mixed MDB2_OK on success, an MDB2 error on failure public
destroyLOB ( lob)

Free any resources allocated during the lifetime of the large object handler object.

引数:
resource$lobstream handle public
getDeclaration ( type,
name,
field 
)

Obtain DBMS specific SQL code portion needed to declare of the given type

引数:
string$typetype to which the value should be converted to
string$namename the field to be declared.
string$fielddefinition of the field
戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. public
getTypeDeclaration ( field)

Obtain DBMS specific SQL code portion needed to declare an text type field to be used in statements like CREATE TABLE.

引数:
array$fieldassociative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:

length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS.

default Text value to be used as default for this field.

notnull Boolean flag that indicates whether this field is constrained to not be set to null.

戻り値:
string DBMS specific SQL code portion that should be used to declare the specified field. public

MDB2_Driver_Datatype_pgsql, と MDB2_Driver_Datatype_mysqlで再定義されています。

Get the list of valid types

This function returns an array of valid types as keys with the values being possible default values for all native datatypes and mapped types for custom datatypes.

戻り値:
mixed array on success, a MDB2 error on failure public
implodeArray ( array,
type = false 
)

apply a type to all values of an array and return as a comma seperated string useful for generating IN statements

public

引数:
array$arraydata array
string$typedetermines type of the field
戻り値:
string comma seperated values
mapNativeDatatype ( field)

Maps a native array description of a field to a MDB2 datatype and length

引数:
array$fieldnative field description
戻り値:
array containing the various possible types, length, sign, fixed public
mapPrepareDatatype ( type)

Maps an mdb2 datatype to mysqli prepare type

引数:
string$type
戻り値:
string public

MDB2_Driver_Datatype_pgsqlで再定義されています。

matchPattern ( pattern,
operator = null,
field = null 
)

build a pattern matching string

public

引数:
array$patterneven keys are strings, odd are patterns (% and _)
string$operatoroptional pattern operator (LIKE, ILIKE and maybe others in the future)
string$fieldoptional field name that is being matched against (might be required when emulating ILIKE)
戻り値:
string SQL pattern

MDB2_Driver_Datatype_mysql, と MDB2_Driver_Datatype_pgsqlで再定義されています。

build string to define pattern escape character

public

戻り値:
string define pattern escape character

MDB2_Driver_Datatype_pgsqlで再定義されています。

quote ( value,
type = null,
quote = true,
escape_wildcards = false 
)

Convert a text value into a DBMS specific format that is suitable to compose query statements.

引数:
string$valuetext string value that is intended to be converted.
string$typetype to which the value should be converted to
bool$quotedetermines if the value should be quoted and escaped
bool$escape_wildcardsif to escape escape wildcards
戻り値:
string text string that represents the given argument value in a DBMS specific format. public
writeLOBToFile ( lob,
file 
)

retrieve LOB from the database

引数:
resource$lobstream handle
string$filename of the file into which the LOb should be fetched
戻り値:
mixed MDB2_OK on success, a MDB2 error on failure protected

構造体

$valid_default_values
初期値:
 array(
        'text'      => '',
        'boolean'   => true,
        'integer'   => 0,
        'decimal'   => 0.0,
        'float'     => 0.0,
        'timestamp' => '1970-01-01 00:00:00',
        'time'      => '00:00:00',
        'date'      => '1970-01-01',
        'clob'      => '',
        'blob'      => '',
    )

このクラスの説明は次のファイルから生成されました:
 全て データ構造 ネームスペース 関数 変数