$_db
$_db : \Horde_Db_Adapter
database handle
Class for interfacing with back end data storage.
Copyright 2001-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
__construct(\Horde_Core_Share_Driver $shareOb) : \Ansel_Storage
Const'r
\Horde_Core_Share_Driver | $shareOb |
createGallery(array $attributes = array(), \Horde_Perms_Permission $perm = null, integer $parent = null) : \Ansel_Gallery
Create and initialise a new gallery object.
array | $attributes | The gallery attributes. |
\Horde_Perms_Permission | $perm | The permissions for the gallery if the defaults are not desirable. |
integer | $parent | The id of the parent gallery (if any) |
A new gallery object.
getGalleryBySlug(string $slug, array $overrides = array()) : \Ansel_Gallery
Retrieve an Ansel_Gallery given the gallery's slug
string | $slug | The gallery slug |
array | $overrides | An array of attributes that should be overridden when the gallery is returned. |
The gallery object
getGallery(integer $gallery_id, array $overrides = array()) : \Ansel_Gallery
Retrieve an Ansel_Gallery given the share id
integer | $gallery_id | The gallery_id to fetch |
array | $overrides | An array of attributes that should be overridden when the gallery is returned. |
getGalleries(array $ids, integer $perms = \Horde_Perms::SHOW) : array
Retrieve an array of Ansel_Gallery objects for the requested ids
array | $ids | Gallery ids to fetch |
integer | $perms | Horde_Perms constant for the perms required. |
An array of Ansel_Gallery objects
emptyGallery(\Ansel_Gallery $gallery)
Empties a gallery of all images.
\Ansel_Gallery | $gallery | The ansel gallery to empty. |
removeGallery(\Ansel_Gallery $gallery)
Removes an Ansel_Gallery.
\Ansel_Gallery | $gallery | The gallery to delete |
getImage(integer $id) : \Ansel_Image
Returns the image corresponding to the given id.
integer | $id | The image_id of the image to retrieve. |
Horde_Exception_NotFound
The image object requested..
saveImage(\Ansel_Image $image) : integer
Save image details to storage. Does NOT update the cached image files.
\Ansel_Image | $image | The image to save. |
The image id
getImages(array $params = array()) : array
Return the images corresponding to the given ids.
array | $params | function parameters: 'ids' - An array of image ids to fetch. 'preserve' - Preserve the order of the image ids when returned. 'gallery_id' - Return all images from requested gallery (ignores 'ids'). 'from' - If passing a gallery, start at this image. 'count' - If passing a gallery, return this many images. |
Horde_Exception_NotFound, InvalidArgumentException
An array of Ansel_Image objects.
getRecentImages(array $galleries = array(), integer $limit = 10, string $slugs = array()) : array
Returns a list of Ansel_Images of the most recently added images for the current user.
array | $galleries | An array of gallery ids to search in. If left empty, will search all galleries with Horde_Perms::SHOW. |
integer | $limit | The maximum number of images to return |
string | $slugs | An array of gallery slugs. |
An array of Ansel_Image objects
countGalleries( $userid, array $params = array()) : integer
Return the count of galleries that the user has specified permissions to and that match any of the requested attributes.
$userid | ||
array | $params | Parameter array: (integer)perm The level of permissions to require for a gallery to return it [Horde_Perms::SHOW] (mixed)attributes Restrict the galleries counted to those matching $attributes. An array of attribute/values pairs or a gallery owner username. (Ansel_Gallery)parent The parent share to start counting at. (boolean)all_levels Return all levels, or just the direct children of $parent? [true] (array)tags Filter results by galleries tagged with tags. |
The count
listGalleries(array $params = array()) : array
Retrieves the current user's gallery list from storage.
array | $params | Optional parameters: (integer)perm The permissions filter to use [Horde_Perms::SHOW] (mixed)attributes Restrict the galleries returned to those matching the filters. Can be an array of attribute/values pairs or a gallery owner username. (integer)parent The parent share to start listing at. (boolean)all_levels If set, return all levels below parent, not just direct children [TRUE] (integer)from The gallery to start listing at. (integer)count The number of galleries to return. (string)sort_by Attribute to sort by. (integer)direction The direction to sort by [Ansel::SORT_ASCENDING] (array)tags An array of tags to limit results by. |
An array of Ansel_Gallery objects
getImageJson(array $images, \Ansel_Style $style = null, boolean $full = false, string $image_view = 'mini', boolean $view_links = false) : string
Retrieve json data for an arbitrary list of image ids, not necessarily from the same gallery.
array | $images | An array of image ids |
\Ansel_Style | $style | A gallery style to force if requesting pretty thumbs. |
boolean | $full | Generate full urls |
string | $image_view | Which image view to use? screen, thumb etc.. |
boolean | $view_links | Include links to the image view |
The json data
listImages(array $params = array()) : array
Lists a slice of the image ids in the given gallery.
array | $params | Filter parameters. integer|array 'gallery_id' - A gallery id to list images from integer 'offset' - The image to start listing from integer 'limit' - How many images to return array|string 'fields' - The fields to return string 'sort' - The field to sort by. array 'filter' - Additional filters. Each element is an array containing 'property', 'op', and 'value' keys. Passing 'IN' as the 'op' and an array as 'value' will produce a SQL IN conditional. |
InvalidArgumentException
An array of images. Either an array of ids, or an array of field values, keyed by id.
getImagesGeodata(array $image_ids = array(), integer $gallery = null) : array
Return images' geolocation data.
array | $image_ids | An array of image_ids to look up. |
integer | $gallery | A gallery id. If this is provided, will return all images in the gallery that have geolocation data ($image_ids would be ignored). |
of geodata
getRecentImagesGeodata(string $user = null, integer $start, integer $count = 8) : array
Like getRecentImages, but returns geotag data for the most recently added images from the current user. Useful for providing images to help locate images at the same place.
string | $user | Limit images to this user |
integer | $start | Start a slice at this image number |
integer | $count | Include this many images |
An array of image ids
setImagesGallery(array $image_ids, integer $gallery_id)
Set the gallery id for a set of images. Useful for bulk updating images when moving from one gallery to another.
array | $image_ids | An array of image ids |
integer | $gallery_id | The gallery id to move the images to. |
buildGallery(\Horde_Share_Object $share) : \Ansel_Gallery
Build a single Ansel_Gallery object from a Horde_Share_Object
\Horde_Share_Object | $share | The share |