DBTableDriverSwitch Class Reference
[DriverSwitch]
Change driver of given DBTable. More...
Public Member Functions |
|
__construct (IDBTable $table, $driver) | |
Constructor. |
|
get_matching_relations (IDBTable $other) | |
Returns relations between two tables.
|
|
get_table_alias () | |
Returns alias of table, if any. |
|
get_table_alias_escaped () | |
Returns alias of table, if any - but
escaped. |
|
get_table_constraints () | |
Returns array of constraints. |
|
get_table_driver () | |
Returns DB driver fro
this table. |
|
get_table_field ($column) | |
Returns field for given column. |
|
get_table_fields () | |
Returns array of columns. |
|
get_table_keys () | |
Returns array of keys. |
|
get_table_name () | |
Returns name of table. |
|
get_table_name_escaped () | |
Returns name of table, but escaped. |
|
get_table_relations () | |
Returns array of relations. |
|
Static Public Member Functions |
|
static | switch_table ($table_name, $driver) |
Switch given table to connection. |
|
Protected Attributes |
|
$delegate | |
$driver |
Detailed Description
Change driver of given DBTable.
Definition at line 8 of file dbtabledriverswitch.csl.php.
Constructor & Destructor Documentation
DBTableDriverSwitch::__construct | ( | IDBTable $ | table, | |
$ | driver | |||
) |
Constructor.
Definition at line 28 of file dbtabledriverswitch.csl.php.
00028 { 00029 $this->delegate = $table; 00030 $this->driver = $driver; 00031 }
Member Function Documentation
DBTableDriverSwitch::get_matching_relations | ( | IDBTable $ | other | ) |
Returns relations between two tables.
- Parameters:
-
IDBTable $other
- Returns:
- array Array of IDBRelations
Implements IDBTable.
Definition at line 125 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_alias | ( | ) |
Returns alias of table, if any.
- Returns:
- string
Implements IDBTable.
Definition at line 60 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_alias_escaped | ( | ) |
Returns alias of table, if any - but escaped.
- Returns:
- string
Implements IDBTable.
Definition at line 78 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_constraints | ( | ) |
Returns array of constraints.
- Returns:
- array Array with IDBConstraint instance as value
Implements IDBTable.
Definition at line 134 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_driver | ( | ) |
Returns DB driver fro this table.
- Returns:
- IDBDriver
Implements IDBTable.
Definition at line 143 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_field | ( | $ | column | ) |
Returns field for given column.
- Parameters:
-
string $column Column name
- Returns:
- IDBField Either field or false if no such field exists
Implements IDBTable.
Definition at line 97 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_fields | ( | ) |
Returns array of columns.
- Returns:
- array Associative array with column name as key and IDBField instance as value
Implements IDBTable.
Definition at line 87 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_keys | ( | ) |
Returns array of keys.
- Returns:
- array Associative array with column name as key and IDField instance as value
Implements IDBTable.
Definition at line 106 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_name | ( | ) |
Returns name of table.
- Returns:
- string
Implements IDBTable.
Definition at line 51 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::get_table_name_escaped | ( | ) |
Returns name of table, but escaped.
- Returns:
- string
Implements IDBTable.
Definition at line 69 of file dbtabledriverswitch.csl.php.
00069 { 00070 return $this->get_table_driver()->escape_database_entity($this->get_table_name(), IDBDriver::TABLE); 00071 }
DBTableDriverSwitch::get_table_relations | ( | ) |
Returns array of relations.
- Returns:
- array Array with IDBRelation instance as value
Implements IDBTable.
Definition at line 115 of file dbtabledriverswitch.csl.php.
static DBTableDriverSwitch::switch_table | ( | $ | table_name, | |
$ | driver | |||
) | [static] |
Switch given table to connection.
- Parameters:
-
string Table or model name IDBDriver|string Driver or driver name
Definition at line 39 of file dbtabledriverswitch.csl.php.
00039 { 00040 DB::create($table_name); 00041 $table = DBTableRepository::get($table_name); 00042 $switched = new DBTableDriverSwitch($table, DB::get_connection($driver)); 00043 DBTableRepository::register($switched, $table_name); 00044 }
Member Data Documentation
DBTableDriverSwitch::$delegate
[protected] |
Definition at line 14 of file dbtabledriverswitch.csl.php.
DBTableDriverSwitch::$driver
[protected] |
Definition at line 20 of file dbtabledriverswitch.csl.php.
The documentation for this class was generated from the following file:
- contributions/db.driverswitch/model/base/dbtabledriverswitch.csl.php