MediaWiki  1.23.2
ORMTable Class Reference
Inheritance diagram for ORMTable:
Collaboration diagram for ORMTable:

Public Member Functions

 __construct ( $tableName='', array $fields=array(), array $defaults=array(), $rowClass=null, $fieldPrefix='')
 Constructor. More...
 
 addToField (array $conditions, $field, $amount)
 Add an amount (can be negative) to the specified field (needs to be numeric). More...
 
 canHaveField ( $name)
 Gets if the object can take a certain field. More...
 
 count (array $conditions=array(), array $options=array())
 Returns the amount of matching records. More...
 
 delete (array $conditions, $functionName=null)
 Removes the object from the database. More...
 
 exists ()
 Checks if the table exists. More...
 
 getAPIParams ( $requireParams=false, $setDefaults=false)
 Get API parameters for the fields supported by this object. More...
 
 getDefaults ()
 Returns a list of default field values. More...
 
 getFieldDescriptions ()
 Returns an array with the fields and their descriptions. More...
 
 getFieldNames ()
 Return the names of the fields. More...
 
 getFields ()
 
 getFieldsFromDBResult (stdClass $result)
 Get an array with fields from a database result, that can be fed directly to the constructor or to setFields. More...
 
 getName ()
 
 getPrefixedField ( $field)
 Takes in a field and returns an it's prefixed version, ready for db usage. More...
 
 getPrefixedFields (array $fields)
 Takes in a field or array of fields and returns an array with their prefixed versions, ready for db usage. More...
 
 getPrefixedValues (array $values)
 Takes in an associative array with field names as keys and their values as value. More...
 
 getReadDb ()
 Get the database ID used for read operations. More...
 
 getReadDbConnection ()
 Get the database type used for read operations. More...
 
 getRowClass ()
 
 getSummaryFields ()
 Returns a list of the summary fields. More...
 
 getTargetWiki ()
 Get the ID of the any foreign wiki to use as a target for database operations. More...
 
 getWriteDbConnection ()
 Get the database type used for read operations. More...
 
 has (array $conditions=array())
 Returns if there is at least one record matching the provided conditions. More...
 
 insertRow (IORMRow $row, $functionName=null, array $options=null)
 Inserts the provided row into the database. More...
 
 newFromArray (array $data, $loadDefaults=false)
 
 newFromDBResult (stdClass $result)
 
 newRow (array $fields, $loadDefaults=false)
 Get a new instance of the class from an array. More...
 
 newRowFromDBResult (stdClass $result)
 Get a new instance of the class from a database result. More...
 
 rawSelect ( $fields=null, array $conditions=array(), array $options=array(), $functionName=null)
 Do the actual select. More...
 
 rawSelectRow (array $fields, array $conditions=array(), array $options=array(), $functionName=null)
 Selects the the specified fields of the records matching the provided conditions. More...
 
 releaseConnection (DatabaseBase $db)
 Releases the lease on the given database connection. More...
 
 removeRow (IORMRow $row, $functionName=null)
 Removes the provided row from the database. More...
 
 select ( $fields=null, array $conditions=array(), array $options=array(), $functionName=null)
 Selects the the specified fields of the records matching the provided conditions and returns them as DBDataObject. More...
 
 selectFields ( $fields=null, array $conditions=array(), array $options=array(), $collapse=true, $functionName=null)
 Selects the the specified fields of the records matching the provided conditions and returns them as associative arrays. More...
 
 selectFieldsRow ( $fields=null, array $conditions=array(), array $options=array(), $collapse=true, $functionName=null)
 Selects the the specified fields of the first record matching the provided conditions and returns it as an associative array, or false when nothing matches. More...
 
 selectObjects ( $fields=null, array $conditions=array(), array $options=array(), $functionName=null)
 Selects the the specified fields of the records matching the provided conditions and returns them as DBDataObject. More...
 
 selectRow ( $fields=null, array $conditions=array(), array $options=array(), $functionName=null)
 Selects the the specified fields of the first matching record. More...
 
 setReadDb ( $db)
 Set the database ID to use for read operations, use DB_XXX constants or an index to the load balancer setup. More...
 
 setTargetWiki ( $wiki)
 Set the ID of the any foreign wiki to use as a target for database operations. More...
 
 unprefixFieldName ( $fieldName)
 Takes a field name with prefix and returns the unprefixed equivalent. More...
 
 unprefixFieldNames (array $fieldNames)
 Takes an array of field names with prefix and returns the unprefixed equivalent. More...
 
 update (array $values, array $conditions=array())
 Update the records matching the provided conditions by setting the fields that are keys in the $values param to their corresponding values. More...
 
 updateRow (IORMRow $row, $functionName=null)
 Updates the provided row in the database. More...
 
 updateSummaryFields ( $summaryFields=null, array $conditions=array())
 Computes the values of the summary fields of the objects matching the provided conditions. More...
 
- Public Member Functions inherited from DBAccessBase
 __construct ( $wiki=false)
 
 getLoadBalancer ()
 Get the database type used for read operations. More...
 
- Public Member Functions inherited from IORMTable
 getLoadBalancer ()
 Get the database type used for read operations. More...
 

Static Public Member Functions

static singleton ()
 Get an instance of this class. More...
 

Protected Member Functions

 getFieldPrefix ()
 Gets the db field prefix. More...
 
 getWriteValues (IORMRow $row)
 Gets the fields => values to write to the table. More...
 
- Protected Member Functions inherited from DBAccessBase
 getConnection ( $id, $groups=array())
 Returns a database connection. More...
 

Protected Attributes

array $defaults = array()
 
string $fieldPrefix = ''
 
string[] $fields = array()
 
integer $readDb = DB_SLAVE
 ID of the database connection to use for read operations. More...
 
string $rowClass = 'ORMRow'
 
string $tableName
 
- Protected Attributes inherited from DBAccessBase
string bool $wiki = false
 $wiki The target wiki's name. More...
 

Static Protected Attributes

static $instanceCache = array()
 

Additional Inherited Members

- Public Attributes inherited from IDBAccessObject
const READ_LATEST = 1
 
const READ_LOCKING = 3
 
const READ_NONE = -1
 
const READ_NORMAL = 0
 

Detailed Description

Definition at line 31 of file ORMTable.php.

Constructor & Destructor Documentation

◆ __construct()

ORMTable::__construct (   $tableName = '',
array  $fields = array(),
array  $defaults = array(),
  $rowClass = null,
  $fieldPrefix = '' 
)

Constructor.

Since
1.21
Parameters
string$tableName
string[]$fields
array$defaults
string | null$rowClass
string$fieldPrefix

Definition at line 92 of file ORMTable.php.

References $defaults, $fieldPrefix, $fields, $rowClass, $tableName, and tableName().

Member Function Documentation

◆ addToField()

ORMTable::addToField ( array  $conditions,
  $field,
  $amount 
)

Add an amount (can be negative) to the specified field (needs to be numeric).

Since
1.22
Parameters
array$conditions
string$field
integer$amount
Returns
boolean Success indicator
Exceptions
MWException

Definition at line 1089 of file ORMTable.php.

References $success, array(), getName(), getPrefixedField(), getPrefixedValues(), getWriteDbConnection(), and releaseConnection().

◆ canHaveField()

ORMTable::canHaveField (   $name)

Gets if the object can take a certain field.

Since
1.20
Parameters
string$name
Returns
boolean

Implements IORMTable.

Definition at line 960 of file ORMTable.php.

References $name, and getFields().

◆ count()

ORMTable::count ( array  $conditions = array(),
array  $options = array() 
)

Returns the amount of matching records.

Condition field names get prefixed.

Note that this can be expensive on large tables. In such cases you might want to use DatabaseBase::estimateRowCount instead.

Since
1.20
Parameters
array$conditions
array$options
Returns
integer

Implements IORMTable.

Definition at line 465 of file ORMTable.php.

References $options, $res, array(), getPrefixedValues(), and rawSelectRow().

Referenced by selectFields().

◆ delete()

ORMTable::delete ( array  $conditions,
  $functionName = null 
)

Removes the object from the database.

Since
1.20
Parameters
array$conditions
string | null$functionName
Returns
boolean Success indicator

Implements IORMTable.

Definition at line 486 of file ORMTable.php.

References array(), getName(), getPrefixedValues(), getWriteDbConnection(), and releaseConnection().

◆ exists()

ORMTable::exists ( )

Checks if the table exists.

Since
1.21
Returns
boolean

Implements IORMTable.

Definition at line 443 of file ORMTable.php.

References $dbr, getName(), getReadDbConnection(), and releaseConnection().

◆ getAPIParams()

ORMTable::getAPIParams (   $requireParams = false,
  $setDefaults = false 
)

Get API parameters for the fields supported by this object.

Since
1.20
Parameters
boolean$requireParams
boolean$setDefaults
Returns
array

Implements IORMTable.

Definition at line 510 of file ORMTable.php.

References $defaults, $params, $type, array(), as, getDefaults(), getFields(), ApiBase\PARAM_DFLT, ApiBase\PARAM_ISMULTI, ApiBase\PARAM_REQUIRED, and ApiBase\PARAM_TYPE.

◆ getDefaults()

ORMTable::getDefaults ( )

Returns a list of default field values.

field name => field value

Since
1.20
Returns
array

Implements IORMTable.

Definition at line 168 of file ORMTable.php.

References $defaults.

Referenced by getAPIParams().

◆ getFieldDescriptions()

ORMTable::getFieldDescriptions ( )

Returns an array with the fields and their descriptions.

field name => field description

Since
1.20
Returns
array

Implements IORMTable.

Definition at line 560 of file ORMTable.php.

References array().

◆ getFieldNames()

ORMTable::getFieldNames ( )

Return the names of the fields.

Since
1.20
Returns
array

Implements IORMTable.

Definition at line 947 of file ORMTable.php.

References getFields().

◆ getFieldPrefix()

ORMTable::getFieldPrefix ( )
protected

Gets the db field prefix.

Since
1.20
Returns
string

Reimplemented in TestORMTable, and PageORMTableForTesting.

Definition at line 129 of file ORMTable.php.

References $fieldPrefix.

Referenced by getPrefixedField(), and unprefixFieldName().

◆ getFields()

ORMTable::getFields ( )
See also
ORMTable::getFields
Since
1.21
Returns
array
Exceptions
MWException

Implements IORMTable.

Reimplemented in TestORMTable, and PageORMTableForTesting.

Definition at line 152 of file ORMTable.php.

References $fields, and array().

Referenced by canHaveField(), getAPIParams(), getFieldNames(), getFieldsFromDBResult(), getWriteValues(), and rawSelect().

◆ getFieldsFromDBResult()

ORMTable::getFieldsFromDBResult ( stdClass  $result)

Get an array with fields from a database result, that can be fed directly to the constructor or to setFields.

Since
1.20
Parameters
stdClass$result
Exceptions
MWException
Returns
array

Implements IORMTable.

Definition at line 825 of file ORMTable.php.

References $fields, $name, $value, array(), as, getFields(), and unprefixFieldNames().

Referenced by newRowFromDBResult(), and selectFields().

◆ getName()

ORMTable::getName ( )
See also
IORMTable::getName
Since
1.21
Returns
string
Exceptions
MWException

Implements IORMTable.

Reimplemented in TestORMTable, and PageORMTableForTesting.

Definition at line 114 of file ORMTable.php.

References $tableName, and tableName().

Referenced by addToField(), delete(), exists(), insertRow(), rawSelect(), rawSelectRow(), update(), and updateRow().

◆ getPrefixedField()

ORMTable::getPrefixedField (   $field)

Takes in a field and returns an it's prefixed version, ready for db usage.

Since
1.20
Parameters
string | array$field
Returns
string

Implements IORMTable.

Definition at line 766 of file ORMTable.php.

References getFieldPrefix().

Referenced by addToField(), getPrefixedFields(), getPrefixedValues(), and getWriteValues().

◆ getPrefixedFields()

ORMTable::getPrefixedFields ( array  $fields)

Takes in a field or array of fields and returns an array with their prefixed versions, ready for db usage.

Since
1.20
Parameters
array | string$fields
Returns
array

Implements IORMTable.

Definition at line 749 of file ORMTable.php.

References $fields, as, and getPrefixedField().

Referenced by rawSelect().

◆ getPrefixedValues()

ORMTable::getPrefixedValues ( array  $values)

Takes in an associative array with field names as keys and their values as value.

The field names are prefixed with the db field prefix.

Since
1.20
Parameters
array$values
Returns
array

Implements IORMTable.

Definition at line 717 of file ORMTable.php.

References $value, array(), as, and getPrefixedField().

Referenced by addToField(), count(), delete(), rawSelect(), update(), and updateRow().

◆ getReadDb()

ORMTable::getReadDb ( )

Get the database ID used for read operations.

Since
1.20
Returns
integer DB_ enum

Implements IORMTable.

Definition at line 571 of file ORMTable.php.

References $readDb.

Referenced by getReadDbConnection(), and updateSummaryFields().

◆ getReadDbConnection()

ORMTable::getReadDbConnection ( )

Get the database type used for read operations.

This is to be used instead of wfGetDB.

See also
LoadBalancer::getConnection
Since
1.20
Returns
DatabaseBase The database object

Implements IORMTable.

Definition at line 621 of file ORMTable.php.

References array(), DBAccessBase\getConnection(), and getReadDb().

Referenced by exists(), rawSelect(), and rawSelectRow().

◆ getRowClass()

ORMTable::getRowClass ( )
See also
IORMTable::getRowClass
Since
1.21
Returns
string

Implements IORMTable.

Reimplemented in TestORMTable, and PageORMTableForTesting.

Definition at line 140 of file ORMTable.php.

References $rowClass.

Referenced by newRow().

◆ getSummaryFields()

ORMTable::getSummaryFields ( )

Returns a list of the summary fields.

These are fields that cache computed values, such as the amount of linked objects of $type. This is relevant as one might not want to do actions such as log changes when these get updated.

Since
1.20
Returns
array

Implements IORMTable.

Definition at line 181 of file ORMTable.php.

References array().

◆ getTargetWiki()

ORMTable::getTargetWiki ( )

Get the ID of the any foreign wiki to use as a target for database operations.

Since
1.20
Returns
String|bool The target wiki, in a form that LBFactory understands (or false if the local wiki is used)

Implements IORMTable.

Definition at line 595 of file ORMTable.php.

References DBAccessBase\$wiki.

◆ getWriteDbConnection()

ORMTable::getWriteDbConnection ( )

Get the database type used for read operations.

This is to be used instead of wfGetDB.

See also
LoadBalancer::getConnection
Since
1.20
Returns
DatabaseBase The database object

Implements IORMTable.

Definition at line 635 of file ORMTable.php.

References array(), DB_MASTER, and DBAccessBase\getConnection().

Referenced by addToField(), delete(), insertRow(), update(), and updateRow().

◆ getWriteValues()

ORMTable::getWriteValues ( IORMRow  $row)
protected

Gets the fields => values to write to the table.

Since
1.22
Parameters
IORMRow$row
Returns
array

Definition at line 1032 of file ORMTable.php.

References $name, $type, $value, array(), as, getFields(), IORMRow\getFields(), and getPrefixedField().

Referenced by insertRow(), and updateRow().

◆ has()

ORMTable::has ( array  $conditions = array())

Returns if there is at least one record matching the provided conditions.

Condition field names get prefixed.

Since
1.20
Parameters
array$conditions
Returns
boolean

Implements IORMTable.

Definition at line 432 of file ORMTable.php.

References array(), and selectRow().

◆ insertRow()

ORMTable::insertRow ( IORMRow  $row,
  $functionName = null,
array  $options = null 
)

Inserts the provided row into the database.

Since
1.22
Parameters
IORMRow$row
string | null$functionName
array | null$options
Returns
boolean Success indicator

Definition at line 1001 of file ORMTable.php.

References $options, $success, getName(), getWriteDbConnection(), getWriteValues(), releaseConnection(), and IORMRow\setField().

◆ newFromArray()

ORMTable::newFromArray ( array  $data,
  $loadDefaults = false 
)
See also
ORMTable::newRow
Deprecated:
use newRow instead
Since
1.20
Parameters
array$data
boolean$loadDefaults
Returns
IORMRow

Definition at line 920 of file ORMTable.php.

◆ newFromDBResult()

ORMTable::newFromDBResult ( stdClass  $result)
See also
ORMTable::newRowFromFromDBResult
Deprecated:
use newRowFromDBResult instead
Since
1.20
Parameters
stdClass$result
Returns
IORMRow

Definition at line 892 of file ORMTable.php.

References newRowFromDBResult().

◆ newRow()

ORMTable::newRow ( array  $fields,
  $loadDefaults = false 
)

Get a new instance of the class from an array.

Since
1.20
Parameters
array$fields
boolean$loadDefaults
Returns
IORMRow

Implements IORMTable.

Reimplemented in PageORMTableForTesting.

Definition at line 934 of file ORMTable.php.

References $fields, and getRowClass().

Referenced by newRowFromDBResult(), and selectObjects().

◆ newRowFromDBResult()

ORMTable::newRowFromDBResult ( stdClass  $result)

Get a new instance of the class from a database result.

Since
1.20
Parameters
stdClass$result
Returns
IORMRow

Implements IORMTable.

Definition at line 905 of file ORMTable.php.

References getFieldsFromDBResult(), and newRow().

Referenced by newFromDBResult().

◆ rawSelect()

ORMTable::rawSelect (   $fields = null,
array  $conditions = array(),
array  $options = array(),
  $functionName = null 
)

Do the actual select.

Since
1.20
Parameters
null | string | array$fields
array$conditions
array$options
null | string$functionName
Returns
ResultWrapper
Exceptions
DBQueryErrorif the query failed (even if the database was in ignoreErrors mode).

Implements IORMTable.

Definition at line 247 of file ORMTable.php.

References $dbr, $error, $fields, $options, array(), getFields(), getName(), getPrefixedFields(), getPrefixedValues(), getReadDbConnection(), and releaseConnection().

Referenced by select(), and selectFields().

◆ rawSelectRow()

ORMTable::rawSelectRow ( array  $fields,
array  $conditions = array(),
array  $options = array(),
  $functionName = null 
)

Selects the the specified fields of the records matching the provided conditions.

Field names do NOT get prefixed.

Since
1.20
Parameters
array$fields
array$conditions
array$options
string | null$functionName
Returns
stdClass

Implements IORMTable.

Definition at line 377 of file ORMTable.php.

References $dbr, $options, getName(), getReadDbConnection(), and releaseConnection().

Referenced by count().

◆ releaseConnection()

ORMTable::releaseConnection ( DatabaseBase  $db)

Releases the lease on the given database connection.

This is useful mainly for connections to a foreign wiki. It does nothing for connections to the local wiki.

See also
LoadBalancer::reuseConnection
Parameters
DatabaseBase$dbthe database
Since
1.20

Reimplemented from DBAccessBase.

Definition at line 650 of file ORMTable.php.

Referenced by addToField(), delete(), exists(), insertRow(), rawSelect(), rawSelectRow(), update(), and updateRow().

◆ removeRow()

ORMTable::removeRow ( IORMRow  $row,
  $functionName = null 
)

Removes the provided row from the database.

Since
1.22
Parameters
IORMRow$row
string | null$functionName
Returns
boolean Success indicator

Definition at line 1067 of file ORMTable.php.

References $success, array(), and IORMRow\getId().

◆ select()

ORMTable::select (   $fields = null,
array  $conditions = array(),
array  $options = array(),
  $functionName = null 
)

Selects the the specified fields of the records matching the provided conditions and returns them as DBDataObject.

Field names get prefixed.

Since
1.20
Parameters
array | string | null$fields
array$conditions
array$options
string | null$functionName
Returns
ORMResult

Implements IORMTable.

Definition at line 198 of file ORMTable.php.

References $options, $res, and rawSelect().

Referenced by selectRow(), and updateSummaryFields().

◆ selectFields()

ORMTable::selectFields (   $fields = null,
array  $conditions = array(),
array  $options = array(),
  $collapse = true,
  $functionName = null 
)

Selects the the specified fields of the records matching the provided conditions and returns them as associative arrays.

Provided field names get prefixed. Returned field names will not have a prefix.

When $collapse is true: If one field is selected, each item in the result array will be this field. If two fields are selected, each item in the result array will have as key the first field and as value the second field. If more then two fields are selected, each item will be an associative array.

Since
1.20
Parameters
array | string | null$fields
array$conditions
array$options
boolean$collapseSet to false to always return each result row as associative array.
string | null$functionName
Returns
array of array

Implements IORMTable.

Definition at line 313 of file ORMTable.php.

References $fields, $options, array(), as, count(), getFieldsFromDBResult(), and rawSelect().

Referenced by selectFieldsRow(), and selectObjects().

◆ selectFieldsRow()

ORMTable::selectFieldsRow (   $fields = null,
array  $conditions = array(),
array  $options = array(),
  $collapse = true,
  $functionName = null 
)

Selects the the specified fields of the first record matching the provided conditions and returns it as an associative array, or false when nothing matches.

This method makes use of selectFields and expects the same parameters and returns the same results (if there are any, if there are none, this method returns false).

See also
ORMTable::selectFields
Since
1.20
Parameters
array | string | null$fields
array$conditions
array$options
boolean$collapseSet to false to always return each result row as associative array.
string | null$functionName
Returns
mixed|array|bool False on failure

Implements IORMTable.

Definition at line 412 of file ORMTable.php.

References $options, false, and selectFields().

◆ selectObjects()

ORMTable::selectObjects (   $fields = null,
array  $conditions = array(),
array  $options = array(),
  $functionName = null 
)

Selects the the specified fields of the records matching the provided conditions and returns them as DBDataObject.

Field names get prefixed.

Since
1.20
Parameters
array | string | null$fields
array$conditions
array$options
string | null$functionName
Returns
array of row objects
Exceptions
DBQueryErrorif the query failed (even if the database was in ignoreErrors mode).

Implements IORMTable.

Definition at line 220 of file ORMTable.php.

References $options, array(), as, newRow(), and selectFields().

◆ selectRow()

ORMTable::selectRow (   $fields = null,
array  $conditions = array(),
array  $options = array(),
  $functionName = null 
)

Selects the the specified fields of the first matching record.

Field names get prefixed.

Since
1.20
Parameters
array | string | null$fields
array$conditions
array$options
string | null$functionName
Returns
IORMRow|bool False on failure

Implements IORMTable.

Definition at line 354 of file ORMTable.php.

References $options, and select().

Referenced by has().

◆ setReadDb()

ORMTable::setReadDb (   $db)

Set the database ID to use for read operations, use DB_XXX constants or an index to the load balancer setup.

Parameters
integer$db
Since
1.20

Implements IORMTable.

Definition at line 583 of file ORMTable.php.

Referenced by updateSummaryFields().

◆ setTargetWiki()

ORMTable::setTargetWiki (   $wiki)

Set the ID of the any foreign wiki to use as a target for database operations.

Parameters
string | bool$wikiThe target wiki, in a form that LBFactory understands (or false if the local wiki shall be used)
Since
1.20

Implements IORMTable.

Definition at line 607 of file ORMTable.php.

References DBAccessBase\$wiki, and wiki.

◆ singleton()

static ORMTable::singleton ( )
static

Get an instance of this class.

Since
1.20
Deprecated:
since 1.21
Returns
IORMTable

Definition at line 804 of file ORMTable.php.

Referenced by TestORMRowTest\getTableInstance().

◆ unprefixFieldName()

ORMTable::unprefixFieldName (   $fieldName)

Takes a field name with prefix and returns the unprefixed equivalent.

Since
1.20
Parameters
string$fieldName
Returns
string

Implements IORMTable.

Definition at line 792 of file ORMTable.php.

References getFieldPrefix().

◆ unprefixFieldNames()

ORMTable::unprefixFieldNames ( array  $fieldNames)

Takes an array of field names with prefix and returns the unprefixed equivalent.

Since
1.20
Parameters
array$fieldNames
Returns
array

Implements IORMTable.

Definition at line 779 of file ORMTable.php.

References array().

Referenced by getFieldsFromDBResult().

◆ update()

ORMTable::update ( array  $values,
array  $conditions = array() 
)

Update the records matching the provided conditions by setting the fields that are keys in the $values param to their corresponding values.

Since
1.20
Parameters
array$values
array$conditions
Returns
boolean Success indicator

Implements IORMTable.

Definition at line 667 of file ORMTable.php.

References getName(), getPrefixedValues(), getWriteDbConnection(), and releaseConnection().

◆ updateRow()

ORMTable::updateRow ( IORMRow  $row,
  $functionName = null 
)

Updates the provided row in the database.

Since
1.22
Parameters
IORMRow$rowThe row to save
string | null$functionName
Returns
boolean Success indicator

Definition at line 974 of file ORMTable.php.

References $success, array(), IORMRow\getId(), getName(), getPrefixedValues(), getWriteDbConnection(), getWriteValues(), and releaseConnection().

◆ updateSummaryFields()

ORMTable::updateSummaryFields (   $summaryFields = null,
array  $conditions = array() 
)

Computes the values of the summary fields of the objects matching the provided conditions.

Since
1.20
Parameters
array | string | null$summaryFields
array$conditions

Implements IORMTable.

Definition at line 690 of file ORMTable.php.

References as, DB_MASTER, getReadDb(), select(), and setReadDb().

Member Data Documentation

◆ $defaults

array ORMTable::$defaults = array()
protected
Since
1.21

Definition at line 70 of file ORMTable.php.

Referenced by __construct(), getAPIParams(), and getDefaults().

◆ $fieldPrefix

string ORMTable::$fieldPrefix = ''
protected
Since
1.21

Definition at line 58 of file ORMTable.php.

Referenced by __construct(), and getFieldPrefix().

◆ $fields

string [] ORMTable::$fields = array()
protected

◆ $instanceCache

ORMTable::$instanceCache = array()
staticprotected

Definition at line 40 of file ORMTable.php.

◆ $readDb

integer ORMTable::$readDb = DB_SLAVE
protected

ID of the database connection to use for read operations.

Can be changed via

See also
setReadDb.
Since
1.20

DB_ enum

Definition at line 79 of file ORMTable.php.

Referenced by getReadDb().

◆ $rowClass

string ORMTable::$rowClass = 'ORMRow'
protected
Since
1.21

Definition at line 64 of file ORMTable.php.

Referenced by __construct(), and getRowClass().

◆ $tableName

string ORMTable::$tableName
protected
Since
1.21

Definition at line 46 of file ORMTable.php.

Referenced by __construct(), and getName().


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