Example #1
0
 /**
  * Returns the Highlights GalleryAlbum object for the given
  * parent album id
  * @param int album id of the parent album
  * @return GalleryAlbum of the child hightlights album (empty GalleryAlbum if exception)
  */
 function getHighlightsAlbum($albumId)
 {
     global $logger;
     $logger->debug(get_class($this) . "::getHighlightsAlbum({$albumId})");
     $hlAlbum = new galleryAlbum();
     list($ret, $parent) = GalleryCoreApi::loadEntitiesById($albumId);
     list($ret, $childIds) = GalleryCoreApi::fetchChildAlbumItemIds($parent);
     if ($childIds) {
         list($ret, $child) = GalleryCoreApi::loadEntitiesById($childIds[0]);
         $hlAlbum = $this->getPackagedAlbum($child->getId());
     }
     return $hlAlbum;
 }