mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2025-08-31 23:44:33 +02:00
src
Builder
Entity
Channel
Item
Category.php
Enclosure.php
Source.php
Media
Channel.php
Item.php
SRSSElement.php
Exception
Parser
Validator
SRSS.php
SRSSTools.php
tests
.gitignore
README.md
autoload.php
composer.json
composer.lock
phpunit.xml
35 lines
680 B
PHP
35 lines
680 B
PHP
<?php
|
|
|
|
namespace Shikiryu\SRSS\Entity\Item;
|
|
|
|
use ReflectionException;
|
|
use Shikiryu\SRSS\Entity\SRSSElement;
|
|
use Shikiryu\SRSS\Validator\HasValidator;
|
|
use Shikiryu\SRSS\Validator\Validator;
|
|
|
|
class Category extends HasValidator implements SRSSElement
|
|
{
|
|
/**
|
|
* @validate string
|
|
*/
|
|
protected string $domain;
|
|
/**
|
|
* @validate string
|
|
*/
|
|
protected string $value;
|
|
|
|
|
|
public function isValid(): bool
|
|
{
|
|
try {
|
|
return (new Validator())->isObjectValid($this);
|
|
} catch (ReflectionException) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return get_object_vars($this);
|
|
}
|
|
} |