db = new DatabaseConnection(); } public function isAlbumGroup( $groupPath ) { if( !array_key_exists( $groupPath , $this->groupCache ) ) { $this->groupCache["$groupPath"] = $this->db->isAlbumGroup( $groupPath ); } return $this->groupCache["$groupPath"]; } public function getImageById( $imageId) { if( !array_key_exists( $imageId , $this->imageCache ) ) { $this->imageCache["$imageId"] = $this->db->getImageById( $imageId ); } return $this->imageCache["$imageId"]; } public function getImageTags ( $albumId, $tagId, $imageId ) { $key = "$albumId-$tagId-$imageId" ; if( !array_key_exists( "$key" , $this->imageTagsCache ) ) { $this->imageTagsCache["$key"] = $this->db->getImageTags ( $albumId, $tagId, $imageId ); } return $this->imageTagsCache["$key"]; } public function getImages( $groupAlbumId, $tagId, $limit, $offset ) { $key = "$groupAlbumId-$tagId-$limit-$offset" ; if( !array_key_exists( "$key" , $this->groupImagesCache ) ) { $this->groupImagesCache["$key"] = $this->db->getImages( $groupAlbumId, $tagId, $limit, $offset); } return $this->groupImagesCache["$key"]; } public function getAlbum( $groupAlbumId, $exact, $limit, $offset ) { $key = "single-$groupAlbumId-$exact-$limit-$offset" ; if( !array_key_exists( "$key" , $this->albumCache ) ) { $this->albumCache["$key"] = $this->db->getAlbum( $groupAlbumId, $exact, $limit, $offset); } return $this->albumCache["$key"]; } } ?>