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.
33 public function getBlockId();
36 * Sets the id of the block.
42 public function setBlockId( $blockId );
45 * Gets the value of the restriction.
50 public function getValue();
53 * Gets the type of restriction
58 public static function getType();
61 * Gets the id of the type of restriction. This id is used in the database.
66 public static function getTypeId();
69 * Creates a new Restriction from a database row.
72 * @param \stdClass $row
75 public static function newFromRow( \stdClass
$row );
78 * Convert a restriction object into a row array for insertion.
83 public function toRow();
86 * Determine if a restriction matches a given title.
89 * @param \Title $title
92 public function matches( \Title
$title );
95 * Determine if a restriction equals another restriction.
98 * @param Restriction $other
101 public function equals( Restriction
$other );
104 * Create a unique hash of the block restriction based on the type and value.
109 public function getHash();