2023-08-02 10:13:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Core\PodcastData;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @psalm-type PodcastDataType = array{
|
|
|
|
* title: ?string,
|
|
|
|
* author: ?string,
|
|
|
|
* link: ?string,
|
|
|
|
* description: ?string,
|
|
|
|
* imageUrl: ?string,
|
|
|
|
* fetchedAtUnix: int,
|
|
|
|
* imageBlob: ?string
|
|
|
|
* }
|
|
|
|
*/
|
2023-08-03 22:23:59 +00:00
|
|
|
class PodcastData implements \JsonSerializable
|
2023-08-02 10:13:16 +00:00
|
|
|
{
|
2023-08-22 17:41:17 +00:00
|
|
|
public function __construct(
|
|
|
|
private ?string $title,
|
|
|
|
private ?string $author,
|
|
|
|
private ?string $link,
|
|
|
|
private ?string $description,
|
|
|
|
private ?string $imageUrl,
|
|
|
|
private int $fetchedAtUnix,
|
|
|
|
private ?string $imageBlob = null
|
2023-12-23 16:25:20 +00:00
|
|
|
) {}
|
2023-08-22 17:41:17 +00:00
|
|
|
|
2023-08-02 10:13:16 +00:00
|
|
|
/**
|
2023-08-03 22:23:59 +00:00
|
|
|
* @return PodcastData
|
|
|
|
* @throws \Exception if the XML data could not be parsed
|
2023-08-02 10:13:16 +00:00
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public static function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null) {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?string
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getTitle() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?string
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getAuthor() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?string
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getLink() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?string
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getDescription() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?string
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getImageUrl() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?int
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getFetchedAtUnix() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-08-03 22:23:59 +00:00
|
|
|
/**
|
|
|
|
* @return ?string
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function getImageBlob() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
2023-12-23 16:25:20 +00:00
|
|
|
public function setImageBlob(?string $blob): void {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return PodcastDataType
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function toArray() {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return PodcastDataType
|
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public function jsonSerialize(): mixed {}
|
2023-08-02 10:13:16 +00:00
|
|
|
|
|
|
|
/**
|
2023-08-03 22:23:59 +00:00
|
|
|
* @param PodcastDataType $data
|
|
|
|
* @return PodcastData
|
2023-08-02 10:13:16 +00:00
|
|
|
*/
|
2023-12-23 16:25:20 +00:00
|
|
|
public static function fromArray(array $data) {}
|
2023-08-02 10:13:16 +00:00
|
|
|
}
|