MediaWiki master
MediaWiki\Block\BlockRestrictionStore Class Reference

Public Member Functions

 __construct (IConnectionProvider $dbProvider, $blockTargetMigrationStage, $wikiId=WikiAwareEntity::LOCAL)
 
 delete (array $restrictions)
 Delete the restrictions.
 
 deleteByBlockId ( $blockId)
 Delete the restrictions by block ID.
 
 equals (array $a, array $b)
 Check if two arrays of Restrictions are effectively equal.
 
 insert (array $restrictions)
 Insert the restrictions into the database.
 
 loadByBlockId ( $blockId)
 Retrieve the restrictions from the database by block ID.
 
 setBlockId ( $blockId, array $restrictions)
 Set the blockId on a set of restrictions and return a new set.
 
 update (array $restrictions)
 Update the list of restrictions.
 
 updateByParentBlockId ( $parentBlockId, array $restrictions)
 Updates the list of restrictions by parent ID.
 

Detailed Description

Definition at line 34 of file BlockRestrictionStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Block\BlockRestrictionStore::__construct ( IConnectionProvider  $dbProvider,
  $blockTargetMigrationStage,
  $wikiId = WikiAwareEntity::LOCAL 
)
Parameters
IConnectionProvider$dbProvider
int$blockTargetMigrationStage
string | false$wikiId

Definition at line 57 of file BlockRestrictionStore.php.

References SCHEMA_COMPAT_READ_MASK.

Member Function Documentation

◆ delete()

MediaWiki\Block\BlockRestrictionStore::delete ( array  $restrictions)

Delete the restrictions.

Since
1.33
Parameters
Restriction[]$restrictions
Returns
bool

Definition at line 238 of file BlockRestrictionStore.php.

◆ deleteByBlockId()

MediaWiki\Block\BlockRestrictionStore::deleteByBlockId (   $blockId)

Delete the restrictions by block ID.

Since
1.33
Parameters
int | int[]$blockId
Returns
bool

Definition at line 259 of file BlockRestrictionStore.php.

Referenced by MediaWiki\Block\BlockRestrictionStore\updateByParentBlockId().

◆ equals()

MediaWiki\Block\BlockRestrictionStore::equals ( array  $a,
array  $b 
)

Check if two arrays of Restrictions are effectively equal.

This is a loose equality check as the restrictions do not have to contain the same block IDs.

Since
1.33
Parameters
Restriction[]$a
Restriction[]$b
Returns
bool

Definition at line 278 of file BlockRestrictionStore.php.

◆ insert()

MediaWiki\Block\BlockRestrictionStore::insert ( array  $restrictions)

Insert the restrictions into the database.

Since
1.33
Parameters
Restriction[]$restrictions
Returns
bool

Definition at line 97 of file BlockRestrictionStore.php.

Referenced by MediaWiki\Block\BlockRestrictionStore\update().

◆ loadByBlockId()

MediaWiki\Block\BlockRestrictionStore::loadByBlockId (   $blockId)

Retrieve the restrictions from the database by block ID.

Since
1.33
Parameters
int | int[]$blockId
Returns
Restriction[]

Definition at line 74 of file BlockRestrictionStore.php.

◆ setBlockId()

MediaWiki\Block\BlockRestrictionStore::setBlockId (   $blockId,
array  $restrictions 
)

Set the blockId on a set of restrictions and return a new set.

Since
1.33
Parameters
int$blockId
Restriction[]$restrictions
Returns
Restriction[]

Definition at line 313 of file BlockRestrictionStore.php.

Referenced by MediaWiki\Block\BlockRestrictionStore\updateByParentBlockId().

◆ update()

MediaWiki\Block\BlockRestrictionStore::update ( array  $restrictions)

Update the list of restrictions.

This method does not allow removing all of the restrictions. To do that, use ::deleteByBlockId().

Since
1.33
Parameters
Restriction[]$restrictions
Returns
bool Whether all operations were successful

Definition at line 126 of file BlockRestrictionStore.php.

References $success, and MediaWiki\Block\BlockRestrictionStore\insert().

Referenced by MediaWiki\Block\BlockRestrictionStore\updateByParentBlockId().

◆ updateByParentBlockId()

MediaWiki\Block\BlockRestrictionStore::updateByParentBlockId (   $parentBlockId,
array  $restrictions 
)

Updates the list of restrictions by parent ID.

Since
1.33
Parameters
int$parentBlockId
Restriction[]$restrictions
Returns
bool Whether all updates were successful

Definition at line 188 of file BlockRestrictionStore.php.

References $success, MediaWiki\Block\BlockRestrictionStore\deleteByBlockId(), SCHEMA_COMPAT_READ_OLD, MediaWiki\Block\BlockRestrictionStore\setBlockId(), and MediaWiki\Block\BlockRestrictionStore\update().


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