/** * Get the crest hash of this kill. * * @return string the crest hash for this kill */ function getCrestHash() { if (is_null($this->crestHash) && $this->id) { $qry = new DBPreparedQuery(); $qry->prepare('SELECT kll_crest_hash FROM kb3_mails WHERE kll_id = ?'); $resultArray = array(&$this->crestHash); // bind results $qry->bind_results($resultArray); // bind parameter $params = array('i', &$this->id); $qry->bind_params($params); $qry->execute(); if ($qry->recordCount()) { $qry->fetch(); } } // kill has not been posted via CREST if (!$this->crestHash) { // calculate the crest hash $this->crestHash = $this->calculateCrestHash(); // if successfully calculated if ($this->crestHash) { // update the crest hash in the database // let's not do this just yet, first need to be sure it's working properly //$this->updateCrestHash($this->crestHash); } } if ($this->crestHash) { $this->putCache(); } return $this->crestHash; }