Added documentation
This commit is contained in:
@ -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)) {
|
||||
|
Reference in New Issue
Block a user