3 * Block restriction interface.
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\Block\Restriction
;
25 interface Restriction
{
28 * Gets the id of the block.
32 public function getBlockId();
35 * Sets the id of the block.
40 public function setBlockId( $blockId );
43 * Gets the value of the restriction.
47 public function getValue();
50 * Gets the type of restriction
54 public function getType();
57 * Gets the id of the type of restriction. This id is used in the database.
61 public function getTypeId();
64 * Creates a new Restriction from a database row.
68 public static function newFromRow( \stdClass
$row );
71 * Convert a restriction object into a row array for insertion.
75 public function toRow();
78 * Determine if a restriction matches a given title.
80 * @param \Title $title
83 public function matches( \Title
$title );
86 * Determine if a restriction equals another restriction.
88 * @param Restriction $other
91 public function equals( Restriction
$other );
94 * Create a unique hash of the block restriction based on the type and value.
98 public function getHash();