當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Photo::getPhotoWithID方法代碼示例

本文整理匯總了PHP中Photo::getPhotoWithID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Photo::getPhotoWithID方法的具體用法?PHP Photo::getPhotoWithID怎麽用?PHP Photo::getPhotoWithID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Photo的用法示例。


在下文中一共展示了Photo::getPhotoWithID方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPoster

 public function getPoster()
 {
     if (Photo::photoExists($this->record['poster_id'])) {
         return Photo::getPhotoWithID($this->record['poster_id']);
     } else {
         $photos = $this->getPhotos();
         return $photos[0];
     }
 }
開發者ID:fulldecent,項目名稱:cameralife,代碼行數:9,代碼來源:Tag.php

示例2: getPopularPhotos

 /**
  * Get an array of the popular photos
  *
  * @access public
  * @return array
  */
 public function getPopularPhotos()
 {
     $popularPhotos = array();
     $query = Database::select('photos', 'id', null, 'ORDER BY hits DESC limit 5');
     while ($photo = $query->fetchAssoc()) {
         $popularPhotos[] = Photo::getPhotoWithID($photo['id']);
     }
     return $popularPhotos;
 }
開發者ID:fulldecent,項目名稱:cameralife,代碼行數:15,代碼來源:Statistics.php

示例3: getPhotos

 /**
  * Returns photos per QUERY, privacy, and paging restrictions
  *
  * @access public
  * @return Photo[]
  */
 public function getPhotos()
 {
     $sort = $this->photoSortSqlForOption($this->sort);
     $condition = $this->whereRestriction;
     if (!$this->showPrivatePhotos) {
         $condition .= ' AND status = 0';
     }
     $query = Database::Select('ratings', 'photos.id', $condition, 'ORDER BY ' . $sort . ' ' . 'LIMIT ' . $this->offset . ',' . $this->pageSize, 'LEFT JOIN photos ON ratings.id = photos.id
          LEFT JOIN exif ON photos.id=exif.photoid and exif.tag="Date taken"');
     $photos = array();
     while ($row = $query->fetchAssoc()) {
         $photos[] = Photo::getPhotoWithID($row['id']);
     }
     return $photos;
 }
開發者ID:fulldecent,項目名稱:cameralife,代碼行數:21,代碼來源:Favorites.php

示例4: getPhotos

 /**
  * Returns photos per QUERY, privacy, and paging restrictions
  *
  * @access public
  * @return Photo[]
  */
 public function getPhotos()
 {
     $sort = $this->photoSortSqlForOption($this->sort);
     $conditions = array();
     $binds = array();
     $conditions[0] = "(path = :1)";
     $binds[1] = $this->path;
     if (!$this->showPrivatePhotos) {
         $conditions[] = 'status = 0';
     }
     $query = Database::select('photos', 'id', implode(' AND ', $conditions), 'ORDER BY ' . $sort . ' ' . 'LIMIT ' . $this->offset . ',' . $this->pageSize, 'LEFT JOIN exif ON photos.id=exif.photoid and exif.tag="Date taken"', $binds);
     $photos = array();
     while ($row = $query->fetchAssoc()) {
         $photos[] = Photo::getPhotoWithID($row['id']);
     }
     return $photos;
 }
開發者ID:fulldecent,項目名稱:cameralife,代碼行數:23,代碼來源:Folder.php

示例5: getPhotos

 /**
  * Returns photos per QUERY, privacy, and paging restrictions
  *
  * @access public
  * @return Photo[]
  */
 public function getPhotos()
 {
     $sort = $this->photoSortSqlForOption($this->sort);
     $conditions = array();
     $binds = array();
     foreach (preg_split('/\\s+/', $this->query) as $i => $queryPart) {
         $conditions[$i] = "(description LIKE :{$i} OR keywords LIKE :{$i})";
         $binds[$i] = '%' . $queryPart . '%';
     }
     if (!$this->showPrivatePhotos) {
         $conditions[] = 'status = 0';
     }
     $query = Database::Select('photos', 'id', implode(' AND ', $conditions), 'ORDER BY ' . $sort . ' ' . 'LIMIT ' . $this->offset . ',' . $this->pageSize, 'LEFT JOIN exif ON photos.id=exif.photoid and exif.tag="Date taken"', $binds);
     $photos = array();
     while ($row = $query->fetchAssoc()) {
         $photos[] = Photo::getPhotoWithID($row['id']);
     }
     return $photos;
 }
開發者ID:fulldecent,項目名稱:cameralife,代碼行數:25,代碼來源:Search.php

示例6: getObject

 /**
  * Factory for the associated object
  *
  * @access public
  * @return mixed
  */
 public function getObject()
 {
     if ($this->record['record_type'] == 'photo') {
         return Photo::getPhotoWithID($this->record['record_id']);
     }
     if ($this->record['record_type'] == 'album') {
         return new Album($this->record['record_id']);
     }
     if ($this->record['record_type'] == 'preference') {
         return $cameralife;
     }
     $cameralife->Error("Unknown receipt type: " . $this->record['record_type']);
     return false;
 }
開發者ID:fulldecent,項目名稱:cameralife,代碼行數:20,代碼來源:AuditTrail.php


注:本文中的Photo::getPhotoWithID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。