Пример #1
0
 /**
  * Get next image id
  *
  * @param PluginLsgallery_ModuleImage_EntityImage $oImage
  *
  * @return PluginLsgallery_ModuleImage_EntityImage|null
  */
 public function GetNextImage($oImage)
 {
     if (false === ($sId = $this->Cache_Get("image_next_{$oImage->getId()}"))) {
         $sId = $this->oMapper->GetNextImageId($oImage);
         $this->Cache_Set($sId, "image_next_{$oImage->getId()}", array('image_update', 'image_new'), 60 * 60 * 24 * 1);
     }
     return $this->GetImageById($sId);
 }
 /**
  * Get next image id
  *
  * @param PluginLsgallery_ModuleImage_EntityImage $oImage
  * @return int|null
  */
 public function GetNextImageId($oImage)
 {
     $sql = "\n                SELECT\n                    image_id\n                FROM\n                    " . Config::Get('db.table.lsgallery.image') . "\n                WHERE\n                    image_id > ?d\n                AND\n                    album_id = ?d\n                ORDER BY\n                    image_id ASC\n                ";
     if ($aRow = $this->oDb->selectRow($sql, $oImage->getId(), $oImage->getAlbumId())) {
         return $aRow['image_id'];
     }
     return null;
 }