MediaWiki  1.23.1
PageORMTableForTesting Class Reference

Dummy ORM table for testing, reading Title objects from the page table. More...

Inheritance diagram for PageORMTableForTesting:
Collaboration diagram for PageORMTableForTesting:

Public Member Functions

 getFields ()
 
 getName ()
 
 getRowClass ()
 
 newRow (array $data, $loadDefaults=false)
 
- 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)
 
 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 ()
 
- 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

Dummy ORM table for testing, reading Title objects from the page table.

Since
1.21

Definition at line 100 of file ORMTableTest.php.

Member Function Documentation

◆ getFieldPrefix()

PageORMTableForTesting::getFieldPrefix ( )
protected
See also
ORMTable::getFieldPrefix
Returns
string

Reimplemented from ORMTable.

Definition at line 147 of file ORMTableTest.php.

◆ getFields()

PageORMTableForTesting::getFields ( )
See also
ORMTable::getFields
Returns
array

Reimplemented from ORMTable.

Definition at line 134 of file ORMTableTest.php.

References array().

◆ getName()

PageORMTableForTesting::getName ( )
See also
ORMTable::getName
Returns
string

Reimplemented from ORMTable.

Definition at line 107 of file ORMTableTest.php.

◆ getRowClass()

PageORMTableForTesting::getRowClass ( )
See also
ORMTable::getRowClass
Returns
string

Reimplemented from ORMTable.

Definition at line 116 of file ORMTableTest.php.

◆ newRow()

PageORMTableForTesting::newRow ( array  $data,
  $loadDefaults = false 
)
See also
ORMTable::newRow
Returns
IORMRow

Reimplemented from ORMTable.

Definition at line 125 of file ORMTableTest.php.

References Title\makeTitle().


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