private function newResultIterator(DIWikiPage $subject)
 {
     $connection = $this->store->getConnection('mw.db');
     $dbKey = $subject->getDBkey();
     // #1955 Ensure to match a possible predefined property
     // (Modification date -> _MDAT)
     if ($subject->getNamespace() === SMW_NS_PROPERTY) {
         $dbKey = DIProperty::newFromUserLabel($subject->getDBkey())->getKey();
     }
     $condition = 'smw_title = ' . $connection->addQuotes($dbKey) . ' AND ' . 'smw_namespace = ' . $connection->addQuotes($subject->getNamespace()) . ' AND ' . 'smw_iw = ' . $connection->addQuotes($subject->getInterwiki()) . ' AND ' . 'smw_subobject != ' . $connection->addQuotes('');
     foreach ($this->skipOn as $skipOn) {
         $condition .= ' AND smw_subobject != ' . $connection->addQuotes($skipOn);
     }
     $res = $connection->select($connection->tablename(SQLStore::ID_TABLE), array('smw_id', 'smw_subobject', 'smw_sortkey'), $condition, __METHOD__);
     return $this->iteratorFactory->newResultIterator($res);
 }
 /**
  * @since 2.5
  *
  * @param SQLStore $store
  *
  * @return SearchTableRebuilder
  */
 public function newSearchTableRebuilder(SQLStore $store)
 {
     return new SearchTableRebuilder($store->getConnection('mw.db'), $this->newSearchTableUpdater($store));
 }
Пример #3
0
 /**
  * @since 2.5
  *
  * @param SQLStore $store
  */
 public function __construct(SQLStore $store)
 {
     $this->store = $store;
     $this->connection = $store->getConnection('mw.db.queryengine');
 }