spoof
 All Data Structures Namespaces Files Functions Variables Pages
Table Class Reference
Inheritance diagram for Table:
Collaboration diagram for Table:

Public Member Functions

 select (\lib360\db\condition\ICondition $condition=NULL, array $values=array(), array $fields=NULL)
 selectRecords (array $conditions=array(), array $fields=NULL)
 update (array $fields,\lib360\db\condition\ICondition $condition=NULL, array $values=array())
 insert (array $fields)
 delete (\lib360\db\condition\ICondition $condition=NULL, array $values=array())
- Public Member Functions inherited from Store
 getName ()
 getDB ()
 setName ($name)
 setDB ($db)
 getExecutor ()
 getLanguage ()

Data Fields

 $fields = array()

Protected Attributes

 $keys
- Protected Attributes inherited from Store
 $name
 $db
 $executor
 $language

Detailed Description

A database table class. Provides functionality for simple operations against a database table. This class can either be extended, or instantiated dynamically via TableFactory.

See also:
TableFactory

Member Function Documentation

delete ( \lib360\db\condition\ICondition  $condition = NULL,
array  $values = array() 
)

Deletes table records that match the supplied database condition.

Parameters:
\lib360\db\condition\ICondition$conditionoptional condition to apply to the query
array$valuesoptional associative array of values for aliases in the condition object
Returns:
integer number of rows deleted

Implements ITable.

Here is the call graph for this function:

insert ( array  $fields)

Inserts a database record.

Parameters:
array$fieldsassociative array of fields for insert (table field) => (update value)
Returns:
integer number of rows inserted

Implements ITable.

Here is the call graph for this function:

select ( \lib360\db\condition\ICondition  $condition = NULL,
array  $values = array(),
array  $fields = NULL 
)

Gets table records that match the supplied database condition.

Parameters:
\lib360\db\condition\ICondition$conditionoptional condition to apply to the query
array$valuesoptional associative array of values for aliases in the condition object
array$fieldsoptional array of fields to return, can be associative for (table field) => (select as field) or a simple array of table field names, will override default $fields property
Returns:
a database recordlist object,
See also:
TODO add order/group by support

Implements ITable.

Here is the call graph for this function:

Here is the caller graph for this function:

selectRecords ( array  $conditions = array(),
array  $fields = NULL 
)

Gets table records by field criteria.

Parameters:
array$conditionsoptional associative array of column names and their values to use as conditions, values will explicitly be cast as strings
array$fieldsoptional array of fields to return, can be associative for (table field) => (select as field) or a simple array of table field names, will override default $fields property
Returns:
IRecordList object containing matched rows
See also:
RecordList

Implements ITable.

Here is the call graph for this function:

update ( array  $fields,
\lib360\db\condition\ICondition  $condition = NULL,
array  $values = array() 
)

Updates database record(s) based on supplied criteria and values.

Parameters:
array$fieldsassociative array of fields to update (table field) => (update value)
\lib360\db\condition\ICondition$conditionoptional object to apply to the update
array$valuesoptional associative array of values for aliases in the condition object
Returns:
integer number of rows updated

Implements ITable.

Here is the call graph for this function:


Field Documentation

$fields = array()

Optional view default fields array. Extending classes may optionally (but recommended) define the list of fields that will be returned by default. This default can be overriden in the select method.

$keys
protected

Table keys array. Extending classes will need to define a simple array listing table's primary keys as element values. NOTE currently not used NOTE this will be useful when implementing selectRecord/updateRecord methods


The documentation for this class was generated from the following file: