MediaWiki  master
Revision\RevisionFactory Interface Reference

Service for constructing revision objects. More...

Inheritance diagram for Revision\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. More...
 
 newRevisionFromArchiveRow ( $row, $queryFlags=0, Title $title=null, array $overrides=[])
 Make a fake revision object from an archive table row. More...
 
 newRevisionFromRow ( $row, $queryFlags=0, Title $title=null)
 Constructs a RevisionRecord given a database row and content slots. More...
 

Detailed Description

Service for constructing revision objects.

Since
1.31
1.32 Renamed from MediaWiki\Storage\RevisionFactory
Note
This was written to act as a drop-in replacement for the corresponding static methods in Revision.

Definition at line 37 of file RevisionFactory.php.

Member Function Documentation

◆ newMutableRevisionFromArray()

Revision\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 Revision\RevisionStore.

◆ newRevisionFromArchiveRow()

Revision\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 | null$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 Revision\RevisionStore.

◆ newRevisionFromRow()

Revision\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

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