/** * @since 2.1 * * @param integer $id * * @return DIWikiPage|null */ public function getDataItemForId($id) { if (!$this->cache->contains($id)) { $row = $this->connection->selectRow($this->tableName, array('smw_title', 'smw_namespace', 'smw_iw', 'smw_subobject'), array('smw_id' => $id), __METHOD__); if ($row === false) { return null; } $hash = HashBuilder::createHashIdFromSegments($row->smw_title, $row->smw_namespace, $row->smw_iw, $row->smw_subobject); $this->saveToCache($id, $hash); } return HashBuilder::newDiWikiPageFromHash($this->cache->fetch($id)); }
/** * @since 2.1 * * @param string $title * @param integer $namespace */ public function deleteRedirectEntry($title, $namespace) { $this->delete($title, $namespace); $hash = HashBuilder::createHashIdFromSegments($title, $namespace); $this->cache->delete($hash); }