/**
  * @param MediawikiApi $api
  * @param WikidataQueryApi|null $wikidataQueryApi
  * @param EntityStoreOptions|null $options
  */
 public function __construct(MediawikiApi $api, WikidataQueryApi $wikidataQueryApi = null, EntityStoreOptions $options = null)
 {
     parent::__construct($options);
     $this->entityLookup = $this->newEntityLookup($api);
     $this->entityIdsForTermLookup = $this->newEntityForTermLookup($api);
     $this->wikidataQueryApi = $wikidataQueryApi;
 }
Пример #2
0
 /**
  * @param Database $database
  * @param EntityStoreOptions $options
  */
 public function __construct(Database $database, EntityStoreOptions $options = null)
 {
     $this->database = $database;
     parent::__construct($options);
     $this->defaultOption(self::OPTION_QUERY_TIME_LIMIT, null);
     $entityDatabase = $this->newEntityDatabase($database);
     $this->entityLookup = new DispatchingEntityLookup($entityDatabase);
     $this->entityForTermLookup = new DispatchingEntityIdForTermLookup($this->newEntityIdForTermLookup($database));
     $this->entityForQueryLookup = new DispatchingEntityIdForQueryLookup($this->newEntityIdForQueryLookup($database));
     $this->entitySaver = $entityDatabase;
 }
 /**
  * @see EntityStore::setupIndexes
  */
 public function setupIndexes()
 {
     $this->entityStore->setupIndexes();
 }
Пример #4
0
 /**
  * @param EntityDocument[] $entities
  */
 public function __construct(array $entities)
 {
     parent::__construct();
     $this->entityLookup = new DispatchingEntityLookup(new InMemoryEntityLookup($entities));
 }