1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Wikibase\EntityStore\Internal; |
4
|
|
|
|
5
|
|
|
use Ask\Language\Description\Description; |
6
|
|
|
use Ask\Language\Option\QueryOptions; |
7
|
|
|
use Wikibase\DataModel\Entity\Item; |
8
|
|
|
use Wikibase\DataModel\Entity\Property; |
9
|
|
|
use Wikibase\EntityStore\ItemIdForQueryLookup; |
10
|
|
|
use Wikibase\EntityStore\PropertyIdForQueryLookup; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Internal class |
14
|
|
|
* |
15
|
|
|
* @licence GPLv2+ |
16
|
|
|
* @author Thomas Pellissier Tanon |
17
|
|
|
*/ |
18
|
|
|
class DispatchingEntityIdForQueryLookup implements ItemIdForQueryLookup, PropertyIdForQueryLookup, EntityIdForQueryLookup { |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var EntityIdForQueryLookup |
22
|
|
|
*/ |
23
|
|
|
private $entityIdForQueryLookup; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param EntityIdForQueryLookup $entityIdForQueryLookup |
27
|
|
|
*/ |
28
|
4 |
|
public function __construct( EntityIdForQueryLookup $entityIdForQueryLookup ) { |
29
|
4 |
|
$this->entityIdForQueryLookup = $entityIdForQueryLookup; |
30
|
4 |
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @see EntityIdsForQueryLookup:getEntityDocumentsForQuery |
34
|
|
|
*/ |
35
|
1 |
|
public function getEntityIdsForQuery( |
36
|
|
|
Description $queryDescription, |
37
|
|
|
QueryOptions $queryOptions = null, |
38
|
|
|
$entityType = null |
39
|
|
|
) { |
40
|
1 |
|
return $this->entityIdForQueryLookup->getEntityIdsForQuery( $queryDescription, $queryOptions, $entityType ); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @see ItemIdsForQueryLookup::getItemForQuery |
45
|
|
|
*/ |
46
|
2 |
|
public function getItemIdsForQuery( Description $queryDescription, QueryOptions $queryOptions = null ) { |
47
|
2 |
|
return $this->entityIdForQueryLookup->getEntityIdsForQuery( $queryDescription, $queryOptions, Item::ENTITY_TYPE ); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @see PropertyIdsForQueryLookup::getPropertyForQuery |
52
|
|
|
*/ |
53
|
2 |
|
public function getPropertyIdsForQuery( Description $queryDescription, QueryOptions $queryOptions = null ) { |
54
|
2 |
|
return $this->entityIdForQueryLookup->getEntityIdsForQuery( $queryDescription, $queryOptions, Property::ENTITY_TYPE ); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|