/** * Get an array or iterator of file objects for files that have a given * SHA-1 content hash. */ function findBySha1($hash) { $dbr = $this->getSlaveDB(); $res = $dbr->select('image', LocalS3File::selectFields(), array('img_sha1' => $hash)); $result = array(); while ($row = $res->fetchObject()) { $result[] = $this->newFileFromRow($row); } $res->free(); return $result; }
function getCacheFields($prefix = 'img_') { $fields = parent::getCacheFields($prefix); $fields[] = $prefix . 'archive_name'; $fields[] = $prefix . 'deleted'; return $fields; }