/** * @since 2.1 */ public function setupDependencies(Store $store) { // This needs to happen before access to a property object is granted // $pageCreator = UtilityFactory::getInstance()->newPageCreator(); foreach ($this->getListOfPropertyInstances() as $propertyInstance) { $store->updateData($propertyInstance->getDependencies()); } }
private function doRealUpdate() { $this->store->setUpdateJobsEnabledState($this->updateJobsEnabledState); if ($this->processSemantics) { $this->store->updateData($this->semanticData); } else { $this->store->clearData($this->semanticData->getSubject()); } return true; }
private function doRealUpdate() { $this->store->setUpdateJobsEnabledState($this->enabledWithUpdateJobs); $semanticData = $this->checkForRequiredRedirectUpdate($this->semanticData); $subject = $semanticData->getSubject(); if ($this->processSemantics) { $this->store->updateData($semanticData); } elseif ($this->store->getObjectIds()->hasIDFor($subject)) { // Only clear the data where it is know that "hasIDFor" is true otherwise // an empty entity is created and later being removed by the // "PropertyTableOutdatedReferenceDisposer" since it is an entity that is // empty == has no reference $this->store->clearData($subject); } return true; }
/** * @param integer $id * @param UpdateJob[] &$updatejobs */ private function createUpdateJobsForSmwIdRange($id, &$updatejobs, &$emptyrange) { // update by internal SMW id --> make sure we get all objects in SMW $db = $this->store->getConnection('mw.db'); $res = $db->select(\SMWSql3SmwIds::TABLE_NAME, array('smw_id', 'smw_title', 'smw_namespace', 'smw_iw', 'smw_subobject'), array("smw_id >= {$id} ", " smw_id < " . $db->addQuotes($id + $this->iterationLimit)), __METHOD__); foreach ($res as $row) { $emptyrange = false; // note this even if no jobs were created if ($this->namespaces && !in_array($row->smw_namespace, $this->namespaces)) { continue; } // Find page to refresh, even for special properties: if ($row->smw_title != '' && $row->smw_title[0] != '_') { $titleKey = $row->smw_title; } elseif ($row->smw_namespace == SMW_NS_PROPERTY && $row->smw_iw == '' && $row->smw_subobject == '') { $titleKey = str_replace(' ', '_', DIProperty::findPropertyLabel($row->smw_title)); } else { $titleKey = ''; } if ($row->smw_subobject !== '' && $row->smw_iw !== SMW_SQL3_SMWDELETEIW) { // leave subobjects alone; they ought to be changed with their pages } elseif ($row->smw_iw === '' && $titleKey != '') { // objects representing pages $title = Title::makeTitleSafe($row->smw_namespace, $titleKey); if ($title !== null) { $updatejobs[] = $this->newUpdateJob($title); } } elseif ($row->smw_iw == SMW_SQL3_SMWREDIIW && $titleKey != '') { // TODO: special treatment of redirects needed, since the store will // not act on redirects that did not change according to its records $title = Title::makeTitleSafe($row->smw_namespace, $titleKey); if ($title !== null && !$title->exists()) { $updatejobs[] = $this->newUpdateJob($title); } } elseif ($row->smw_iw == SMW_SQL3_SMWIW_OUTDATED || $row->smw_iw == SMW_SQL3_SMWDELETEIW) { // remove outdated internal object references $this->cleanUpPropertyTablesFor($row->smw_id); } elseif ($titleKey != '') { // "normal" interwiki pages or outdated internal objects -- delete $diWikiPage = new DIWikiPage($titleKey, $row->smw_namespace, $row->smw_iw); $emptySemanticData = new SemanticData($diWikiPage); $this->store->updateData($emptySemanticData); } } $db->freeResult($res); }