mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2024-09-20 16:28:35 +02:00
33 lines
634 B
PHP
33 lines
634 B
PHP
|
<?php
|
||
|
|
||
|
namespace Shikiryu\SRSS\Entity\Item;
|
||
|
|
||
|
use Shikiryu\SRSS\Entity\SRSSElement;
|
||
|
use Shikiryu\SRSS\Validator\HasValidator;
|
||
|
use Shikiryu\SRSS\Validator\Validator;
|
||
|
|
||
|
class Category extends HasValidator implements SRSSElement
|
||
|
{
|
||
|
/**
|
||
|
* @string
|
||
|
*/
|
||
|
public string $domain;
|
||
|
/**
|
||
|
* @string
|
||
|
*/
|
||
|
public string $value;
|
||
|
|
||
|
public function isValid(): bool
|
||
|
{
|
||
|
try {
|
||
|
return (new Validator())->isObjectValid($this);
|
||
|
} catch (\ReflectionException $e) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function toArray(): array
|
||
|
{
|
||
|
return get_object_vars($this);
|
||
|
}
|
||
|
}
|