Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | interface EntityLookup { |
||
18 | |||
19 | /** |
||
20 | * @note Implementations of this method may or may not resolve redirects. |
||
21 | * Code that needs control over redirect resolution should use an |
||
22 | * EntityRevisionLookup instead. |
||
23 | * |
||
24 | * @since 2.0 |
||
25 | * |
||
26 | * @param EntityId $entityId |
||
27 | * |
||
28 | * @return EntityDocument|null |
||
29 | * @throws EntityLookupException |
||
30 | */ |
||
31 | public function getEntity( EntityId $entityId ); |
||
32 | |||
33 | /** |
||
34 | * Returns whether the given entity can bee looked up using |
||
35 | * getEntity(). This avoids loading and deserializing entity content |
||
36 | * just to check whether the entity exists. |
||
37 | * |
||
38 | * @note Implementations of this method may or may not resolve redirects. |
||
39 | * Code that needs control over redirect resolution should use an |
||
40 | * EntityRevisionLookup instead. |
||
41 | * |
||
42 | * @since 1.1 |
||
43 | * |
||
44 | * @param EntityId $entityId |
||
45 | * |
||
46 | * @return bool |
||
47 | * @throws EntityLookupException |
||
48 | */ |
||
49 | public function hasEntity( EntityId $entityId ); |
||
50 | |||
51 | } |
||
52 |