31 lines
688 B
PHP
31 lines
688 B
PHP
<?php
|
|
namespace PhotoPrismUpload\Entities;
|
|
|
|
use Monolog\Logger;
|
|
use PhotoPrismUpload\API\LoggerFactory;
|
|
|
|
class Album
|
|
{
|
|
public string $uid = '';
|
|
public string $slug = '';
|
|
public string $title = '';
|
|
public ?string $token = null;
|
|
|
|
public function __construct(
|
|
array $response
|
|
) {
|
|
$this->uid = $response['UID'];
|
|
$this->slug = $response['Slug'];
|
|
$this->title = $response['Title'];
|
|
$this->logger = LoggerFactory::create('PhotoPrismUpload.Album');
|
|
}
|
|
|
|
public function getUrlPath(): ?string
|
|
{
|
|
if (empty($this->token)) {
|
|
return null;
|
|
}
|
|
return "/s/{$this->token}/{$this->slug}";
|
|
}
|
|
}
|