3 * Service for constructing revision objects.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
23 namespace MediaWiki\Storage
;
29 * Service for constructing revision objects.
33 * @note This was written to act as a drop-in replacement for the corresponding
34 * static methods in Revision.
36 interface RevisionFactory
{
39 * Constructs a new RevisionRecord based on the given associative array following the MW1.29
40 * database convention for the Revision constructor.
42 * MCR migration note: this replaces Revision::newFromRow
44 * @deprecated since 1.31. Use a MutableRevisionRecord instead.
46 * @param array $fields
47 * @param int $queryFlags Flags for lazy loading behavior, see IDBAccessObject::READ_XXX.
48 * @param Title|null $title
50 * @return MutableRevisionRecord
53 public function newMutableRevisionFromArray( array $fields, $queryFlags = 0, Title
$title = null );
56 * Constructs a RevisionRecord given a database row and content slots.
58 * MCR migration note: this replaces Revision::newFromRow for rows based on the
59 * revision, slot, and content tables defined for MCR since MW1.31.
61 * @param object $row A query result row as a raw object.
62 * Use RevisionStore::getQueryInfo() to build a query that yields the required fields.
63 * @param int $queryFlags Flags for lazy loading behavior, see IDBAccessObject::READ_XXX.
64 * @param Title|null $title
66 * @return RevisionRecord
68 public function newRevisionFromRow( $row, $queryFlags = 0, Title
$title = null );
71 * Make a fake revision object from an archive table row. This is queried
72 * for permissions or even inserted (as in Special:Undelete)
74 * MCR migration note: this replaces Revision::newFromArchiveRow
76 * @param object $row A query result row as a raw object.
77 * Use RevisionStore::getArchiveQueryInfo() to build a query that yields the
79 * @param int $queryFlags Flags for lazy loading behavior, see IDBAccessObject::READ_XXX.
81 * @param array $overrides An associative array that allows fields in $row to be overwritten.
82 * Keys in this array correspond to field names in $row without the "ar_" prefix, so
83 * $overrides['user'] will override $row->ar_user, etc.
85 * @return RevisionRecord
87 public function newRevisionFromArchiveRow(