1 | <?php |
||
17 | class RedirectResolvingEntityLookup implements EntityLookup { |
||
18 | |||
19 | /** |
||
20 | * An EntityRedirectResolvingDecorator wrapping and emulating a EntityLookup. |
||
21 | * |
||
22 | * @note This does not formally implement EntityLookup! |
||
23 | * |
||
24 | * @var EntityLookup |
||
25 | */ |
||
26 | private $lookup; |
||
27 | |||
28 | /** |
||
29 | * @param EntityLookup $lookup The lookup to use |
||
30 | */ |
||
31 | 9 | public function __construct( EntityLookup $lookup ) { |
|
34 | |||
35 | /** |
||
36 | * @see EntityLookup::getEntity |
||
37 | * |
||
38 | * If the given entity ID points to a redirect, that redirect is resolved and the |
||
39 | * target entity returned. |
||
40 | * |
||
41 | * Callers can detect the presence of a redirect by comparing the ID of the returned |
||
42 | * Entity with the request ID. |
||
43 | * |
||
44 | * @param EntityId $entityId |
||
45 | * |
||
46 | * @return EntityDocument|null |
||
47 | * @throws EntityLookupException |
||
48 | */ |
||
49 | 5 | public function getEntity( EntityId $entityId ) { |
|
56 | |||
57 | /** |
||
58 | * @see EntityLookup::hasEntity |
||
59 | * |
||
60 | * If the given entity ID points to a redirect, that redirect is resolved and the |
||
61 | * existence of the target entity is checked. |
||
62 | * |
||
63 | * @param EntityId $entityId |
||
64 | * |
||
65 | * @return bool |
||
66 | * @throws EntityLookupException |
||
67 | */ |
||
68 | 4 | public function hasEntity( EntityId $entityId ) { |
|
75 | |||
76 | } |
||
77 |