Skip to content

Commit

Permalink
Merge 671c06a into 89f178d
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobw committed Apr 23, 2021
2 parents 89f178d + 671c06a commit 8f2846d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Expand Up @@ -2,6 +2,7 @@

## Version 5.4.0 (under development)
* Added `EntityRedirectLookup::FOR_UPDATE` constant
* Added `EntityRedirectTargetLookup` (extracted from `EntityRedirectLookup`)

## Version 5.3.0 (2020-03-10)
* Allow installing with data-values/data-values 3.0.0
Expand Down
22 changes: 1 addition & 21 deletions src/Lookup/EntityRedirectLookup.php
Expand Up @@ -12,12 +12,7 @@
* @license GPL-2.0-or-later
* @author Daniel Kinzler
*/
interface EntityRedirectLookup {

/**
* @since 5.4
*/
public const FOR_UPDATE = 'for update';
interface EntityRedirectLookup extends EntityRedirectTargetLookup {

/**
* Returns the IDs of the entities that redirect to (are aliases of) the given target entity.
Expand All @@ -31,19 +26,4 @@ interface EntityRedirectLookup {
*/
public function getRedirectIds( EntityId $targetId );

/**
* Returns the redirect target associated with the given redirect ID.
*
* @since 2.0
*
* @param EntityId $entityId
* @param string $forUpdate If EntityRedirectLookup::FOR_UPDATE is given the redirect will be
* determined from the canonical master database.
*
* @return EntityId|null The ID of the redirect target, or null if $entityId does not refer to a
* redirect.
* @throws EntityRedirectLookupException
*/
public function getRedirectForEntityId( EntityId $entityId, $forUpdate = '' );

}
36 changes: 36 additions & 0 deletions src/Lookup/EntityRedirectTargetLookup.php
@@ -0,0 +1,36 @@
<?php

namespace Wikibase\DataModel\Services\Lookup;

use Wikibase\DataModel\Entity\EntityId;

/**
* Service interface for looking up an Entity's redirect target id.
*
* @since 5.4
*
* @license GPL-2.0-or-later
*/
interface EntityRedirectTargetLookup {

/**
* @since 5.4
*/
public const FOR_UPDATE = 'for update';

/**
* Returns the redirect target associated with the given redirect ID.
*
* @since 2.0
*
* @param EntityId $entityId
* @param string $forUpdate If EntityRedirectTargetLookup::FOR_UPDATE is given the redirect will be
* determined from the canonical master database.
*
* @return EntityId|null The ID of the redirect target, or null if $entityId does not refer to a
* redirect.
* @throws EntityRedirectLookupException
*/
public function getRedirectForEntityId( EntityId $entityId, $forUpdate = '' );

}

0 comments on commit 8f2846d

Please sign in to comment.