Added documentation

This commit is contained in:
2021-11-27 12:52:29 +01:00
parent ae4eb30a73
commit 29b429e239
4 changed files with 166 additions and 17 deletions

View File

@ -1,16 +1,30 @@
<?php
namespace PhotoPrismUpload\Entities;
use Monolog\Logger;
use PhotoPrismUpload\API\LoggerFactory;
/** A PhotoPrism Album */
class Album
{
/** @var string $uid Unique Id of the album */
public string $uid = '';
/** @var string $slug URL slug of the album */
public string $slug = '';
/** @var string $title Title of the album */
public string $title = '';
/** @var string|null $token Secret token of the album. Needs to be set by the API */
public ?string $token = null;
/**
* Creates a new album from the api response
*
* @param array $response Photoprism API response containing an album object
*
* @return void
*/
public function __construct(
array $response
) {
@ -20,6 +34,13 @@ class Album
$this->logger = LoggerFactory::create('PhotoPrismUpload.Album');
}
/**
* Gets the URL path for this album.
* Starts with a leading /
* Returns null if the album's token is not set
*
* @return string|null
*/
public function getUrlPath(): ?string
{
if (empty($this->token)) {