Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Validators\EntityConstraintProvider Class Reference

Provides constraints for each entity type. More...

Public Member Functions

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

Private Attributes

 $siteLinkConflictLookup
 

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)

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

◆ $siteLinkConflictLookup

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

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