Gallery

Functions


// Retrieve all albums
get_album();

// Retrieve album by alias = 'gallery' and all relations
get_album_by('alias', 'gallery', ['with' => ['translations', 'photo', 'photo.translation']]);

mixed get_album ( $options = [] )
$options array
  • id (int/array) - album id
  • alias (string/array) - album alias
  • album_status (int/array) - album status
  • album_order (string) - album order (by default id ASC)
  • photo_order (string) - photo order (by default order ASC)
  • photo_status (int/array) - photo status
  • with (string/array) - relations (available relations: 'photo', 'translations', 'photo.translation')
Returns array of Album object collection or single Album object.

// Retrieve album by alias = gallery
get_album_by(['alias', 'gallery']);

mixed get_album_by ( $key, $value, $options = [] )
$key string
  • id - album id
  • alias - album slug
  • album_status - album status
$value mixed The value
$options array
  • id (int/array) - album id
  • alias (string/array) - album alias
  • album_status (int/array) - album status
  • album_order (string) - album order (by default id ASC)
  • photo_order (string) - photo order (by default order ASC)
  • photo_status (int/array) - photo status
  • with (string/array) - relations (available relations: 'photo', 'translations', 'photo.translation')
Returns array of Album object collection or single Album object. On failure return an empty array and if value was the string or integer then returns null.

Album Object

$id int Album id
$status int Album status
$album_alias string Album alias
$image string Album image
$created_at string Album created date
$modified_at string Album edited date
$photos object collection Album photos (relation)
$translations object collection Album translations (relation)

Photo Object

$id int Photo id
$status int Photo status
$order int Photo order
$album_id int Related album id
$photo_name string Photo name
$photo_size string Photo size
$photo_extension string Photo extension
$photo_mime string Photo mime
$created_at string Photo created date
$modified_at string Photo edited date
$translations object collection Photo translations (relation)

Album Translation Object

$album_id int Album id
$language string Album language
$name string Album name
$description string Album description

Photo Translation Object

$photo_id int Photo id
$language string Photo language
$caption string Photo caption
$description string Photo description