2023-04-12 00:28:14 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Shikiryu\SRSS\Entity\Channel;
|
|
|
|
|
|
|
|
use Shikiryu\SRSS\Entity\SRSSElement;
|
|
|
|
use Shikiryu\SRSS\Validator\HasValidator;
|
|
|
|
use Shikiryu\SRSS\Validator\Validator;
|
|
|
|
|
|
|
|
class Category extends HasValidator implements SRSSElement
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @string
|
|
|
|
*/
|
2023-04-12 14:41:45 +02:00
|
|
|
public ?string $domain = null;
|
2023-04-12 00:28:14 +02:00
|
|
|
/**
|
|
|
|
* @string
|
|
|
|
*/
|
2023-04-12 14:41:45 +02:00
|
|
|
public ?string $value = null;
|
2023-04-12 00:28:14 +02:00
|
|
|
|
|
|
|
public function isValid(): bool
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
return (new Validator())->isObjectValid($this);
|
|
|
|
} catch (\ReflectionException $e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function toArray(): array
|
|
|
|
{
|
|
|
|
return get_object_vars($this);
|
|
|
|
}
|
|
|
|
}
|