1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2024-05-19 06:11:32 +02:00
ShikiryuRSS/src/Entity/Channel.php
2023-04-06 11:07:06 +02:00

47 lines
1.0 KiB
PHP

<?php
namespace Shikiryu\SRSS\Entity;
use Shikiryu\SRSS\Entity\Channel\Image;
class Channel implements SRSSElement
{
public string $title;
public string $link;
public string $description;
public ?string $language;
public ?string $copyright;
public ?string $managingEditor;
public ?string $webMaster;
public ?string $pubDate;
public ?string $lastBuildDate;
public ?string $category;
public ?string $generator;
public ?string $docs;
public ?string $cloud;
public ?string $ttl;
public ?Image $image;
public ?string $rating;
public ?string $textInput;
public ?string $skipHours;
public ?string $skipDays;
public array $required = ['title', 'link', 'description'];
/**
* @return bool
*/
public function isValid(): bool
{
return count(array_filter($this->required, fn($field) => !empty($this->{$field}))) === 0;
}
/**
* @return array
*/
public function toArray(): array
{
return get_object_vars($this);
}
}