WikibaseLexeme
MediaWiki WikibaseLexeme extension
Loading...
Searching...
No Matches
Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements Class Reference

Public Member Functions

 __construct (LexemeStatementEntityReferenceExtractor $refExtractor)
 
 validate (Lexeme $one, Lexeme $two)
 Validate the two Lexemes and collect the violations along with any violations from previous calls.
 
 getViolations ()
 Get violations of all validate() calls.
 

Private Member Functions

 collectViolations (LexemeId $entityIdsFrom, array $entityIds, LexemeId $notToReference)
 

Private Attributes

 $violations = []
 
 $refExtractor
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements::__construct ( LexemeStatementEntityReferenceExtractor $refExtractor)

Member Function Documentation

◆ collectViolations()

Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements::collectViolations ( LexemeId $entityIdsFrom,
array $entityIds,
LexemeId $notToReference )
private
Parameters
LexemeId$entityIdsFromThe LexemeId that the $entityIds references are from
EntityId[]$entityIdsThe list of EntityIds that we are checking
LexemeId$notToReferenceThe LexemeId that when referenced will cause violations

◆ getViolations()

Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements::getViolations ( )

Get violations of all validate() calls.

Returns
array[] with each element containing: [ LexemeId $source, EntityId $reference, LexemeId $target ] Where:
  • $source is the source Lexeme of the reference
  • $reference is the reference to $target
  • $target is the LexemeId being referenced

◆ validate()

Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements::validate ( Lexeme $one,
Lexeme $two )

Validate the two Lexemes and collect the violations along with any violations from previous calls.

Parameters
Lexeme$one
Lexeme$two
Returns
bool true if valid

Member Data Documentation

◆ $refExtractor

Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements::$refExtractor
private

◆ $violations

Wikibase\Lexeme\Domain\Merge\NoCrossReferencingLexemeStatements::$violations = []
private

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