## Class TDbMetaDataCommon

Description

Common database command: insert, update, select and delete.

Base class for database specific insert, update, select and delete command builder.

- abstract:
- since: 3.1
- version: $Id: TDbMetaDataCommon.php 1606 2007-01-09 10:42:06Z wei $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/ActiveRecord/Vendor/TDbMetaDataCommon.php (line 25)

    TComponent
       |
       --TDbMetaData
          |
          --TDbMetaDataCommon

Direct descendents

Class | Description
--- | ---
TMysqlMetaData | TMysqlMetaData specialized command builder for Mysql database.
TPgsqlMetaData | TPgsqlMetaData class.
TSqliteMetaData | TSqliteMetaData specialized command builder for SQLite database.

Method Summary
TDbCommand getCountRecordsCommand (TDbConnection $conn, TActiveRecordCriteria $criteria)
TDbCommand getDeleteByCriteriaCommand (TDbConnection $conn, TActiveRecordCriteria $criteria)
TDbCommand getDeleteByPkCommand (TDbConnection $conn, array $keys)
TDbCommand getDeleteCommand (TDbConnection $conn, TActiveRecord $record)
TDbCommand getFindByCriteriaCommand (TDbConnection $conn, [TActiveRecordCriteria $criteria = null])
TDbCommand getFindByPkCommand (TDbConnection $conn, array $keys)
TDbCommand getFindBySqlCommand (TDbConnection $conn, string $sql, array $parameters)
TDbCommand getFindInPksCommand (TDbConnection $conn, array $keys)
TDbCommand getInsertCommand (TDbConnection $conn, TActiveRecord $record)
void getSqlFromCriteria (mixed $conn, TActiveRecordCriteria $criteria)
TDbCommand getUpdateCommand (TDbConnection $conn, TActiveRecord $record)
void updatePostInsert (TDbConnection $conn, TActiveRecord $record)
Methods
getCountRecordsCommand (line 82)

Command to count the number of record matching the criteria.

- return: count command.
- access: public

TDbCommand getCountRecordsCommand (TDbConnection $conn, TActiveRecordCriteria $criteria)

- TDbConnection $conn: database connection.
- TActiveRecordCriteria $criteria: criteria object

getDeleteByCriteriaCommand (line 196)

SQL command to delete records by criteria

- return: delete command.
- access: public

TDbCommand getDeleteByCriteriaCommand (TDbConnection $conn, TActiveRecordCriteria $criteria)

- TDbConnection $conn: database connection.
- TActiveRecordCriteria $criteria: criteria object.

getDeleteByPkCommand (line 178)

SQL command to delete records by primary keys.

- return: delete command.
- access: public

TDbCommand getDeleteByPkCommand (TDbConnection $conn, array $keys)

- TDbConnection $conn: database connection.
- array $keys: list of primary keys

getDeleteCommand (line 162)

SQL database command to delete an active record.

- return: delete command.
- access: public

TDbCommand getDeleteCommand (TDbConnection $conn, TActiveRecord $record)

- TDbConnection $conn: database connection.
- TActiveRecord $record: record for deletion.

getFindByCriteriaCommand (line 67)

SQL database command for finding records using a criteria object.

- return: find by criteria command.
- access: public

TDbCommand getFindByCriteriaCommand (TDbConnection $conn, [TActiveRecordCriteria $criteria = null])

- TDbConnection $conn: database connection.
- TActiveRecordCriteria $criteria: criteria object

getFindByPkCommand (line 33)

SQL database command for finding the record by primary keys.

- return: find by primary key command.
- access: public

TDbCommand getFindByPkCommand (TDbConnection $conn, array $keys)

- TDbConnection $conn: database connection.
- array $keys: primary keys name value pairs.

getFindBySqlCommand (line 100)

Sql command with parameters binded.

- return: sql command.
- access: public

TDbCommand getFindBySqlCommand (TDbConnection $conn, string $sql, array $parameters)

- TDbConnection $conn: database connection.
- string $sql: sql query.
- array $parameters: parameters to be bound

getFindInPksCommand (line 49)

SQL database command for finding records by a list of primary keys.

- return: find by list of primary keys command.
- access: public

TDbCommand getFindInPksCommand (TDbConnection $conn, array $keys)

- TDbConnection $conn: database connection.
- array $keys: list of primary keys to match.

getInsertCommand (line 114)

SQL database command for insert a new record.

- return: active record insert command
- access: public

TDbCommand getInsertCommand (TDbConnection $conn, TActiveRecord $record)

- TDbConnection $conn: database connection.
- TActiveRecord $record: new record to be inserted.

getSqlFromCriteria (line 91)

- access: protected
- abstract:

void getSqlFromCriteria (mixed $conn, TActiveRecordCriteria $criteria)

Redefined in descendants as:

- TMysqlMetaData::getSqlFromCriteria() : Build the SQL search string from the criteria object for Postgress database.
- TPgsqlMetaData::getSqlFromCriteria() : Build the SQL search string from the criteria object for Postgress database.
- TSqliteMetaData::getSqlFromCriteria() : Build the SQL search string from the criteria object for Postgress database.

getUpdateCommand (line 144)

SQL database command to update an active record.

- return: update command.
- access: public

TDbCommand getUpdateCommand (TDbConnection $conn, TActiveRecord $record)

- TDbConnection $conn: database connection.
- TActiveRecord $record: record for update.

updatePostInsert (line 129)

Update the record object's sequence values after insert.

- access: public

void updatePostInsert (TDbConnection $conn, TActiveRecord $record)

- TDbConnection $conn: database connection.
- TActiveRecord $record: record object.

#### Inherited Methods

Inherited From TDbMetaData

> TDbMetaData::__construct()
> TDbMetaData::bindArrayKeyValues()
> TDbMetaData::bindParameterValues()
> TDbMetaData::createBindedCommand()
> TDbMetaData::createCriteriaBindedCommand()
> TDbMetaData::getColumn()
> TDbMetaData::getColumns()
> TDbMetaData::getCompositeKeysCriteria()
> TDbMetaData::getForeignKeys()
> TDbMetaData::getInsertableColumns()
> TDbMetaData::getInsertColumNames()
> TDbMetaData::getInsertColumnValues()
> TDbMetaData::getIsView()
> TDbMetaData::getObjectKeyValues()
> TDbMetaData::getPrimaryKeyCriteria()
> TDbMetaData::getPrimaryKeys()
> TDbMetaData::getSelectionColumns()
> TDbMetaData::getTableName()
> TDbMetaData::getUpdatableColumns()
> TDbMetaData::getUpdateBindings()
> TDbMetaData::postQuery()
> TDbMetaData::postQueryRow()
> TDbMetaData::quoteTuple()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 14 Jan 2007 21:42:16 -0500 by phpDocumentor 1.3.0RC4