hashes = $hashes; // index foreach($this->hashes as $hash) { /** @var $hash Hash */ $this->index[$hash->getName1()][$hash->getName2()] = $hash; } } // ----------------------------------------------------------------------------------------------------------------- public function findHashByHash($hashA, $hashB) { if(isset($this->index[$hashA][$hashB])) { return $this->index[$hashA][$hashB]; } return NULL; } /** * @return mixed */ public function getHashes() { return $this->hashes; } }