Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Validators\EntityConstraintProvider Class Reference

Provides constraints for each entity type. More...

+ Collaboration diagram for Wikibase\Repo\Validators\EntityConstraintProvider:

Public Member Functions

 __construct (SiteLinkConflictLookup $siteLinkConflictLookup, TermValidatorFactory $termValidatorFactory, array $redirectBadgeItems)
 
 getUpdateValidators ( $entityType)
 Returns validators for hard global constraints that should be enforced on every update of an entity of the given type (including creation).
 
 getCreationValidators ( $entityType, EntityId $entityId)
 Returns validators for soft global constraints that should be enforced only upon creation of an entity of the given type.
 

Private Attributes

SiteLinkConflictLookup $siteLinkConflictLookup
 
TermValidatorFactory $termValidatorFactory
 
array $redirectBadgeItems
 

Detailed Description

Provides constraints for each entity type.

Used to enforce global constraints upon save.

See also
docs/constraints.wiki
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\EntityConstraintProvider::__construct ( SiteLinkConflictLookup $siteLinkConflictLookup,
TermValidatorFactory $termValidatorFactory,
array $redirectBadgeItems )

Member Function Documentation

◆ getCreationValidators()

Wikibase\Repo\Validators\EntityConstraintProvider::getCreationValidators ( $entityType,
EntityId $entityId )

Returns validators for soft global constraints that should be enforced only upon creation of an entity of the given type.

This will include at least the validators returned by getUpdateValidators() for that type.

Note
During updates, such soft constraints should be checked selectively by the respective ChangeOps, so not all such (potentially expensive) validators are applied for all updates.
Returns
EntityValidator[]

◆ getUpdateValidators()

Wikibase\Repo\Validators\EntityConstraintProvider::getUpdateValidators ( $entityType)

Returns validators for hard global constraints that should be enforced on every update of an entity of the given type (including creation).

Parameters
string$entityType
Returns
EntityValidator[]

Member Data Documentation

◆ $redirectBadgeItems

array Wikibase\Repo\Validators\EntityConstraintProvider::$redirectBadgeItems
private

◆ $siteLinkConflictLookup

SiteLinkConflictLookup Wikibase\Repo\Validators\EntityConstraintProvider::$siteLinkConflictLookup
private

◆ $termValidatorFactory

TermValidatorFactory Wikibase\Repo\Validators\EntityConstraintProvider::$termValidatorFactory
private

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