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

Class: MDB_Manager_xxx_

Source Location: /MDB-1.3.0/doc/Modules_Manager_skeleton.php

Class Overview

MDB_Manager_Common
   |
   --MDB_Manager_xxx_

MDB Xxx driver for the management modules


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 76]
MDB Xxx driver for the management modules


[ Top ]


Method Detail

alterTable   [line 249]

mixed alterTable( &$db, string $name, array $changes, boolean $check, object $dbs)

alter an existing table
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $name   —  name of the table that is intended to be changed.
array   $changes   — 

associative array that contains the details of each type of change that is intended to be performed. The types of changes that are currently supported are defined as follows:

name

New name for the table.

AddedFields

Associative array with the names of fields to be added as indexes of the array. The value of each entry of the array should be set to another associative array with the properties of the fields to be added. The properties of the fields should be the same as defined by the Metabase parser.

Additionally, there should be an entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement.

RemovedFields

Associative array with the names of fields to be removed as indexes of the array. Currently the values assigned to each entry are ignored. An empty array should be used for future compatibility.

RenamedFields

Associative array with the names of fields to be renamed as indexes of the array. The value of each entry of the array should be set to another associative array with the entry named name with the new field name and the entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement.

ChangedFields

Associative array with the names of the fields to be changed as indexes of the array. Keep in mind that if it is intended to change either the name of a field and any other properties, the ChangedFields array entries should have the new names of the fields as array indexes.

The value of each entry of the array should be set to another associative array with the properties of the fields to that are meant to be changed as array entries. These entries should be assigned to the new values of the respective properties. The properties of the fields should be the same as defined by the Metabase parser.

If the default property is meant to be added, removed or changed, there should also be an entry with index ChangedDefault assigned to 1. Similarly, if the notnull constraint is to be added or removed, there should also be an entry with index ChangedNotNull assigned to 1.

Additionally, there should be an entry named Declaration that is expected to contain the portion of the field changed declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement. Example array( 'name' => 'userlist', 'AddedFields' => array( 'quota' => array( 'type' => 'integer', 'unsigned' => 1 'Declaration' => 'quota INT' ) ), 'RemovedFields' => array( 'file_limit' => array(), 'time_limit' => array() ), 'ChangedFields' => array( 'gender' => array( 'default' => 'M', 'ChangeDefault' => 1, 'Declaration' => "gender CHAR(1) DEFAULT 'M'" ) ), 'RenamedFields' => array( 'sex' => array( 'name' => 'gender', 'Declaration' => "gender CHAR(1) DEFAULT 'M'" ) ) )

boolean   $check   —  indicates whether the function should just check if the DBMS driver can perform the requested table alterations if the value is true or actually perform them otherwise.
   &$db   — 

[ Top ]

createDatabase   [line 89]

mixed createDatabase( &$db, string $name, object $dbs)

create a new database
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $name   —  name of the database that should be created
   &$db   — 

[ Top ]

createIndex   [line 368]

mixed createIndex( &$db, string $table, string $name, array $definition, object $dbs)

get the stucture of a field into an array
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $table   —  name of the table on which the index is to be created
string   $name   —  name of the index to be created
array   $definition   — 

associative array that defines properties of the index to be created. Currently, only one property named FIELDS is supported. This property is also an associative with the names of the index fields as array indexes. Each entry of this array is set to another type of associative array that specifies properties of the index that are specific to each field.

Currently, only the sorting property is supported. It should be used to define the sorting direction of the index. It may be set to either ascending or descending.

Not all DBMS support index sorting direction configuration. The DBMS drivers of those that do not support it ignore this property. Use the function support() to determine whether the DBMS driver can manage indexes. Example array( 'FIELDS' => array( 'user_name' => array( 'sorting' => 'ascending' ), 'last_login' => array() ) )

   &$db   — 

[ Top ]

createSequence   [line 435]

mixed createSequence( &$db, string $seq_name, string $start, object $dbs)

create sequence
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $seq_name   —  name of the sequence to be created
string   $start   —  start value of the sequence; default is 1
   &$db   — 

[ Top ]

createTable   [line 144]

mixed createTable( &$db, string $name, array $fields, object $dbs)

create a new table
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $name   —  Name of the database that should be created
array   $fields   — 

Associative array that contains the definition of each field of the new table The indexes of the array entries are the names of the fields of the table an the array entry values are associative arrays like those that are meant to be passed with the field definitions to get[Type]Declaration() functions.

Example array(

'id' => array( 'type' => 'integer', 'unsigned' => 1 'notnull' => 1 'default' => 0 ), 'name' => array( 'type' => 'text', 'length' => 12 ), 'password' => array( 'type' => 'text', 'length' => 12 ) );

   &$db   — 

[ Top ]

dropDatabase   [line 105]

mixed dropDatabase( &$db, string $name, object $dbs)

drop an existing database
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $name   —  name of the database that should be dropped
   &$db   — 

[ Top ]

dropIndex   [line 385]

mixed dropIndex( &$db, string $table, string $name, object $dbs)

drop existing index
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $table   —  name of table that should be used in method
string   $name   —  name of the index to be dropped
   &$db   — 

[ Top ]

dropSequence   [line 451]

mixed dropSequence( &$db, string $seq_name, object $dbs)

drop existing sequence
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $seq_name   —  name of the sequence to be dropped
   &$db   — 

[ Top ]

getSequenceDefinition   [line 482]

mixed getSequenceDefinition( &$db, string $sequence, object $dbs)

get the stucture of a sequence into an array
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $sequence   —  name of sequence that should be used in method
   &$db   — 

[ Top ]

getTableFieldDefinition   [line 327]

mixed getTableFieldDefinition( &$db, string $table, string $field_name, object $dbs)

get the stucture of a field into an array
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $table   —  name of table that should be used in method
string   $field_name   —  name of field that should be used in method
   &$db   — 

[ Top ]

getTableIndexDefinition   [line 418]

mixed getTableIndexDefinition( &$db, string $table, string $index_name, object $dbs)

get the stucture of an index into an array
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $table   —  name of table that should be used in method
string   $index_name   —  name of index that should be used in method
   &$db   — 

[ Top ]

listDatabases   [line 264]

mixed listDatabases( &$db, object $dbs)

list all databases
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
   &$db   — 

[ Top ]

listSequences   [line 466]

mixed listSequences( &$db, object $dbs)

list all sequences in the current database
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
   &$db   — 

[ Top ]

listTableFields   [line 310]

mixed listTableFields( &$db, string $table, object $dbs)

list all fields in a tables in the current database
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $table   —  name of table that should be used in method
   &$db   — 

[ Top ]

listTableIndexes   [line 401]

mixed listTableIndexes( &$db, string $table, object $dbs)

list all indexes in a table
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
string   $table   —  name of table that should be used in method
   &$db   — 

[ Top ]

listTables   [line 294]

mixed listTables( &$db, object $dbs)

list all tables in the current database
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
   &$db   — 

[ Top ]

listUsers   [line 279]

mixed listUsers( &$db, object $dbs)

list all users
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs   —  database object that is extended by this class
   &$db   — 

[ Top ]


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