当前位置: 首页>>代码示例>>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;未经允许,请勿转载。