MDB2
[ class tree: MDB2 ] [ index: MDB2 ] [ all elements ]

Class: MDB2_Driver_Datatype_Common

Source Location: /MDB2-2.0.0beta3/MDB2/Driver/Datatype/Common.php

Class Overview


MDB2_Driver_Common: Base class that is extended by each MDB2 driver


Author(s):

Variables

Methods


Child classes:

MDB2_Driver_Datatype_ibase
MDB2 MySQL driver
MDB2_Driver_Datatype_mysql
MDB2 MySQL driver
MDB2_Driver_Datatype_fbsql
MDB2 FrontbaseSQL driver
MDB2_Driver_Datatype_oci8
MDB2 OCI8 driver
MDB2_Driver_Datatype_pgsql
MDB2 PostGreSQL driver
MDB2_Driver_Datatype_sqlite
MDB2 SQLite driver
MDB2_Driver_Datatype_mssql
MDB2 MS SQL driver
MDB2_Driver_Datatype_mysqli
MDB2 MySQL driver

Inherited Variables

Inherited Methods


Class Details

[line 60]
MDB2_Driver_Common: Base class that is extended by each MDB2 driver


[ Top ]


Class Variables

$db_index =

[line 74]


Type:   mixed


[ Top ]

$valid_types = array(
        'text'      => true,
        'boolean'   => true,
        'integer'   => true,
        'decimal'   => true,
        'float'     => true,
        'date'      => true,
        'time'      => true,
        'timestamp' => true,
        'clob'      => true,
        'blob'      => true,
    )

[line 62]


Type:   mixed


[ Top ]



Method Detail

MDB2_Driver_Datatype_Common (Constructor)   [line 86]

MDB2_Driver_Datatype_Common MDB2_Driver_Datatype_Common( $db_index)


Parameters:

   $db_index   — 

[ Top ]

__construct (Constructor)   [line 81]

MDB2_Driver_Datatype_Common __construct( $db_index)

Constructor

Parameters:

   $db_index   — 

[ Top ]

convertResult   [line 194]

mixed convertResult( mixed $value, int $type)

convert a value to a RDBMS indepdenant MDB2 type
  • Return: converted value or a MDB2 error on failure
  • Access: public

Overridden in child classes as:

MDB2_Driver_Datatype_ibase::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_mysql::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_fbsql::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_oci8::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_pgsql::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_sqlite::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_mssql::convertResult()
convert a value to a RDBMS indepdenant MDB2 type
MDB2_Driver_Datatype_mysqli::convertResult()
convert a value to a RDBMS indepdenant MDB2 type

Parameters:

mixed   $value   —  value to be converted
int   $type   —  constant that specifies which type to convert to

[ Top ]

convertResultRow   [line 214]

mixed convertResultRow( $types, array $row, resource $result)

convert a result row
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

resource   $result   —  result identifier
array   $row   —  array with data
   $types   — 

[ Top ]

createLOB   [line 1041]

integer createLOB( array $arguments)

Create a handler object of a specified class with functions to retrieve data from a large object data stream.
  • Return: handle value that should be passed as argument insubsequent calls to functions that retrieve data from the large object input stream.
  • Access: public

Parameters:

array   $arguments   — 

An associative array with parameters to create the handler object. The array indexes are the names of the parameters and the array values are the respective parameter values.

Some parameters are specific of the class of each type of handler object that is created. The following parameters are common to all handler object classes:

type

Name of the type of the built-in supported class that will be used to create the handler object. There are currently four built-in types of handler object classes: data, resultlob, inputfile and outputfile.

The data handler class is the default class. It simply reads data from a given data string.

The resultlob handler class is meant to read data from a large object retrieved from a query result. This class is not used directly by applications.

The inputfile handler class is meant to read data from a file to use in prepared queries with large object field parameters.

The outputfile handler class is meant to write to a file data from result columns with large object fields. The functions to read from this type of large object do not return any data. Instead, the data is just written to the output file with the data retrieved from a specified large object handle.

class

Name of the class of the handler object that will be created if the Type argument is not specified. This argument should be used when you need to specify a custom handler class.

database

Database object as returned by MDB2::connect. This is an option argument needed by some handler classes like resultlob.

The following arguments are specific of the inputfile handler class:

file

Integer handle value of a file already opened for writing.

file_name

Name of a file to be opened for writing if the File argument is not specified.

The following arguments are specific of the outputfile handler class:

file

Integer handle value of a file already opened for writing.

file_name

Name of a file to be opened for writing if the File argument is not specified.

buffer_length

Integer value that specifies the length of a buffer that will be used to read from the specified large object.

LOB

Integer handle value that specifies a large object from which the data to be stored in the output file will be written.

result

Integer handle value as returned by the function MDB2::query() or MDB2::execute() that specifies the result set that contains the large object value to be retrieved. If the LOB argument is specified, this argument is ignored.

row

Integer value that specifies the number of the row of the result set that contains the large object value to be retrieved. If the LOB argument is specified, this argument is ignored.

field

Integer or string value that specifies the number or the name of the column of the result set that contains the large object value to be retrieved. If the LOB argument is specified, this argument is ignored.

binary

Boolean value that specifies whether the large object column to be retrieved is of binary type (blob) or otherwise is of character type (clob). If the LOB argument is specified, this argument is ignored.

The following argument is specific of the data handler class:

data

String of data that will be returned by the class when it requested with the readLOB() method.

The following argument is specific of the resultlob handler class:

resultLOB

Integer handle value of a large object result row field.


[ Top ]

destroyLOB   [line 1242]

void destroyLOB( integer $lob)

Free any resources allocated during the lifetime of the large object handler object.
  • Access: public

Parameters:

integer   $lob   —  argument handle that is returned by the MDB2::createLOB() method.

[ Top ]

endOfLOB   [line 1207]

boolean endOfLOB( integer $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.
  • Return: flag that indicates whether it was reached the end of the large object input stream
  • Access: public

Parameters:

integer   $lob   —  argument handle that is returned by the MDB2::createLOB() method.

[ Top ]

freeBLOBValue   [line 790]

void freeBLOBValue( int $value)

free a binary large object
  • Access: public

Parameters:

int   $value   —  lob index

[ Top ]

freeCLOBValue   [line 758]

void freeCLOBValue( int $value)

free a character large object
  • Access: public

Parameters:

int   $value   —  lob index

[ Top ]

getDeclaration   [line 250]

string getDeclaration( string $type, string $name, string $field)

Obtain DBMS specific SQL code portion needed to declare of the given type
  • Return: DBMS specific SQL code portion that should be used to declare the specified field.
  • Access: public

Parameters:

string   $type   —  type to which the value should be converted to
string   $name   —  name the field to be declared.
string   $field   —  definition of the field

[ Top ]

implodeArray   [line 1263]

string implodeArray( array $array, [string $type = false])

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

Parameters:

array   $array   —  data array
string   $type   —  determines type of the field

[ Top ]

quote   [line 597]

string quote( string $value, [string $type = null])

Convert a text value into a DBMS specific format that is suitable to compose query statements.
  • Return: text string that represents the given argument value in a DBMS specific format.
  • Access: public

Parameters:

string   $value   —  text string value that is intended to be converted.
string   $type   —  type to which the value should be converted to

[ Top ]

readLOB   [line 1168]

mixed readLOB( integer $lob, &$data, integer $length, string $data)

Read data from large object input stream.

Parameters:

integer   $lob   —  argument handle that is returned by the MDB2::createLOB() method.
string   $data   —  reference to a variable that will hold data to be read from the large object input stream
integer   $length   —  value that indicates the largest ammount ofdata to be read from the large object input stream.
   &$data   — 

[ Top ]

setResultTypes   [line 114]

mixed setResultTypes( &$result, string $types, resource $result)

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.

  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

resource   $result   —  result identifier
string   $types   —  array 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.
   &$result   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:28:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.