/** * @see Hashable::getHash * * @since 1.0 * * @return string */ public function getHash() { if ($this->hash === null) { $this->hash = sha1($this->getType() . $this->propertyId->getHash() . $this->subDescription->getHash() . $this->isSubProperty); } return $this->hash; }
private function getCacheId(Description $description, QueryOptions $queryOptions = null, $entityType) { $key = self::CACHE_ID_PREFIX . WIKIBASE_DATAMODEL_VERSION . '-' . $entityType . '-' . $description->getHash(); if ($queryOptions !== null) { $key .= '-' . $queryOptions->getOffset() . '-' . $queryOptions->getLimit(); } return $key; }
/** * @dataProvider instanceProvider * * @since 1.0 * * @param Description $description */ public function testGetHashStability(Description $description) { $this->assertEquals($description->getHash(), $description->getHash()); }