
The Album methods allow you to access albums and content in Director by querying all albums or a single album.
Return a list of all albums. Optional only_published parameter allows you to specify if you want to return only published albums or all albums. only_published defaults to true. Optional only_active parameter allows you to specify if you want to return active content or all content. only_active defaults to true. Optional list_only (added in version 1.0.1 of the DirectorPHP class) parameter allows you to only return the list of albums (with no associated content).
<?php
include('classes/DirectorPHP.php');
$director = new Director('your-api-key', 'your-api-path');
$albums = $director->album->all();
foreach($albums as $album) {
echo $album->name . '<br />';
}
?>
Returns a single album along with its content. Optional only_active parameter allows you to specify if you want to return active content or all content. only_active defaults to true.
<?php
include('classes/DirectorPHP.php');
$director = new Director('your-api-key', 'your-api-path');
$album = $director->album->get(1);
echo $album->name;
?>
Retrieves the galleries that the provided album is a part of. Only gallery data is returned, no associated albums or their content are returned.
<?php
include('classes/DirectorPHP.php');
$director = new Director('your-api-key', 'your-api-path');
$galleries = $director->album->galleries(1);
echo count($galleries);
?>
