コード例 #1
0
 /**
  * 
  * Returns an image object for the version of an image in a set
  * @param string $version original|main|thumb|admin_thumb
  * @return object
  */
 public function get_version($versionKey)
 {
     $PerchGallery_ImageVersions = new PerchGallery_ImageVersions();
     $Version = $PerchGallery_ImageVersions->get_by_key($this->id(), $versionKey);
     return $Version;
 }
コード例 #2
0
 public function get_recent_for_dashboard($count = 4)
 {
     $sql = 'SELECT * FROM ' . $this->table . ' 
             ORDER BY imageID DESC LIMIT ' . $count;
     $rows = $this->db->get_rows($sql);
     if (PerchUtil::count($rows)) {
         $PerchGallery_ImageVersions = new PerchGallery_ImageVersions();
         for ($i = 0; $i < count($rows); $i++) {
             /* loop though versions array */
             $Version = $PerchGallery_ImageVersions->get_by_key($rows[$i]['imageID'], 'admin_preview');
             $rows[$i]['image_admin_preview'] = $Version;
         }
     }
     return $this->return_instances($rows);
 }