EntityRedirectTargetLookup
last analyzed

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
getRedirectForEntityId() 0 1 ?
1
<?php
2
3
namespace Wikibase\DataModel\Services\Lookup;
4
5
use Wikibase\DataModel\Entity\EntityId;
6
7
/**
8
 * Service interface for looking up an Entity's redirect target id.
9
 *
10
 * @since 5.4
11
 *
12
 * @license GPL-2.0-or-later
13
 */
14
interface EntityRedirectTargetLookup {
15
16
	/**
17
	 * @since 5.4
18
	 */
19
	public const FOR_UPDATE = 'for update';
20
21
	/**
22
	 * Returns the redirect target associated with the given redirect ID.
23
	 *
24
	 * @since 2.0
25
	 *
26
	 * @param EntityId $entityId
27
	 * @param string $forUpdate If EntityRedirectTargetLookup::FOR_UPDATE is given the redirect will be
28
	 *        determined from the canonical master database.
29
	 *
30
	 * @return EntityId|null The ID of the redirect target, or null if $entityId does not refer to a
31
	 * redirect.
32
	 * @throws EntityRedirectLookupException
33
	 */
34
	public function getRedirectForEntityId( EntityId $entityId, $forUpdate = '' );
35
36
}
37