Exemple #1
0
 function getDerivatives()
 {
     $m = new Dase_DBO_MediaFile($this->db);
     $m->p_collection_ascii_id = $this->p_collection_ascii_id;
     $m->p_serial_number = $this->p_serial_number;
     $m->orderBy('width');
     $m->addWhere('size', $this->size, '!=');
     return $m->find();
 }
Exemple #2
0
 public function getSearchMd5($r)
 {
     $file = new Dase_DBO_MediaFile($this->db);
     $file->md5 = $r->get('q');
     $res = "files matching {$file->md5}\n";
     foreach ($file->find() as $mf) {
         $item = new Dase_DBO_Item($this->db);
         $item->load($mf->item_id);
         $res .= $item->getUrl($r->app_root) . "\n";
     }
     $r->renderResponse($res);
 }
Exemple #3
0
 function deleteMedia($path_to_media = '')
 {
     $mf = new Dase_DBO_MediaFile($this->db);
     $mf->item_id = $this->id;
     foreach ($mf->find() as $doomed) {
         if ($path_to_media) {
             $doomed->moveFileToDeleted($path_to_media);
         }
         $doomed->delete();
     }
 }