MediaWiki  1.23.8
TestORMTable Class Reference
Inheritance diagram for TestORMTable:
Collaboration diagram for TestORMTable:

Public Member Functions

 getFields ()
 Returns an array with the fields and their types this object contains. More...
 
 getName ()
 Returns the name of the database table objects of this type are stored in. More...
 
 getRowClass ()
 Returns the name of a IORMRow implementing class that represents single rows in this table. More...
 
- Public Member Functions inherited from ORMTable
 __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...
 
 getFieldsFromDBResult (stdClass $result)
 Get an array with fields from a database result, that can be fed directly to the constructor or to setFields. More...
 
 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...
 
 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...
 

Protected Member Functions

 getFieldPrefix ()
 Gets the db field prefix. More...
 
- Protected Member Functions inherited from ORMTable
 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ORMTable
static singleton ()
 Get an instance of this class. More...
 
- Public Attributes inherited from IDBAccessObject
const READ_LATEST = 1
 
const READ_LOCKING = 3
 
const READ_NONE = -1
 
const READ_NORMAL = 0
 
- Protected Attributes inherited from ORMTable
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 inherited from ORMTable
static $instanceCache = array()
 

Detailed Description

Definition at line 151 of file TestORMRowTest.php.

Member Function Documentation

◆ getFieldPrefix()

TestORMTable::getFieldPrefix ( )
protected

Gets the db field prefix.

Since
1.20
Returns
string

Reimplemented from ORMTable.

Definition at line 215 of file TestORMRowTest.php.

◆ getFields()

TestORMTable::getFields ( )

Returns an array with the fields and their types this object contains.

This corresponds directly to the fields in the database, without prefix.

field name => type

Allowed types:

  • id
  • str
  • int
  • float
  • bool
  • array
  • blob
Since
1.20
Returns
array

Reimplemented from ORMTable.

Definition at line 195 of file TestORMRowTest.php.

References array().

◆ getName()

TestORMTable::getName ( )

Returns the name of the database table objects of this type are stored in.

Since
1.20
Returns
string

Reimplemented from ORMTable.

Definition at line 160 of file TestORMRowTest.php.

◆ getRowClass()

TestORMTable::getRowClass ( )

Returns the name of a IORMRow implementing class that represents single rows in this table.

Since
1.20
Returns
string

Reimplemented from ORMTable.

Definition at line 172 of file TestORMRowTest.php.


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