MediaWiki REL1_31
MediaWiki\Storage\RevisionFactory Interface Reference

Service for constructing revision objects. More...

Inheritance diagram for MediaWiki\Storage\RevisionFactory:

Public Member Functions

 newMutableRevisionFromArray (array $fields, $queryFlags=0, Title $title=null)
 Constructs a new RevisionRecord based on the given associative array following the MW1.29 database convention for the Revision constructor.
 
 newRevisionFromArchiveRow ( $row, $queryFlags=0, Title $title=null, array $overrides=[])
 Make a fake revision object from an archive table row.
 
 newRevisionFromRow ( $row, $queryFlags=0, Title $title=null)
 Constructs a RevisionRecord given a database row and content slots.
 

Detailed Description

Service for constructing revision objects.

Since
1.31
Note
This was written to act as a drop-in replacement for the corresponding static methods in Revision.

Definition at line 36 of file RevisionFactory.php.

Member Function Documentation

◆ newMutableRevisionFromArray()

MediaWiki\Storage\RevisionFactory::newMutableRevisionFromArray ( array $fields,
$queryFlags = 0,
Title $title = null )

Constructs a new RevisionRecord based on the given associative array following the MW1.29 database convention for the Revision constructor.

MCR migration note: this replaces Revision::newFromRow

Deprecated
since 1.31. Use a MutableRevisionRecord instead.
Parameters
array$fields
int$queryFlagsFlags for lazy loading behavior, see IDBAccessObject::READ_XXX.
Title | null$title
Returns
MutableRevisionRecord
Exceptions
MWException

Implemented in MediaWiki\Storage\RevisionStore.

◆ newRevisionFromArchiveRow()

MediaWiki\Storage\RevisionFactory::newRevisionFromArchiveRow ( $row,
$queryFlags = 0,
Title $title = null,
array $overrides = [] )

Make a fake revision object from an archive table row.

This is queried for permissions or even inserted (as in Special:Undelete)

MCR migration note: this replaces Revision::newFromArchiveRow

Parameters
object$rowA query result row as a raw object. Use RevisionStore::getArchiveQueryInfo() to build a query that yields the required fields.
int$queryFlagsFlags for lazy loading behavior, see IDBAccessObject::READ_XXX.
Title$title
array$overridesAn associative array that allows fields in $row to be overwritten. Keys in this array correspond to field names in $row without the "ar_" prefix, so $overrides['user'] will override $row->ar_user, etc.
Returns
RevisionRecord

Implemented in MediaWiki\Storage\RevisionStore.

◆ newRevisionFromRow()

MediaWiki\Storage\RevisionFactory::newRevisionFromRow ( $row,
$queryFlags = 0,
Title $title = null )

Constructs a RevisionRecord given a database row and content slots.

MCR migration note: this replaces Revision::newFromRow for rows based on the revision, slot, and content tables defined for MCR since MW1.31.

Parameters
object$rowA query result row as a raw object. Use RevisionStore::getQueryInfo() to build a query that yields the required fields.
int$queryFlagsFlags for lazy loading behavior, see IDBAccessObject::READ_XXX.
Title | null$title
Returns
RevisionRecord

Implemented in MediaWiki\Storage\RevisionStore.


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