mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2025-09-10 02:24:33 +02:00
@@ -2,14 +2,47 @@
|
||||
|
||||
namespace Shikiryu\SRSS\Entity\Channel;
|
||||
|
||||
class Image
|
||||
use Shikiryu\SRSS\Entity\SRSSElement;
|
||||
use Shikiryu\SRSS\Validator\HasValidator;
|
||||
use Shikiryu\SRSS\Validator\Validator;
|
||||
|
||||
class Image extends HasValidator implements SRSSElement
|
||||
{
|
||||
/**
|
||||
* @required
|
||||
* @url
|
||||
*/
|
||||
public string $url;
|
||||
/**
|
||||
* @required
|
||||
* @nohtml
|
||||
*/
|
||||
public string $title;
|
||||
/**
|
||||
* @required
|
||||
* @url
|
||||
*/
|
||||
public string $link;
|
||||
public int $width; // Maximum value for width is 144, default value is 88.
|
||||
public int $height; //Maximum value for height is 400, default value is 31.
|
||||
/**
|
||||
* @int
|
||||
* @max 144
|
||||
*/
|
||||
public int $width = 88; // Maximum value for width is 144, default value is 88.
|
||||
/**
|
||||
* @int
|
||||
* @max 400
|
||||
*/
|
||||
public int $height = 31; //Maximum value for height is 400, default value is 31.
|
||||
|
||||
public string $description;
|
||||
|
||||
public array $required = ['url', 'title', 'link'];
|
||||
public function isValid(): bool
|
||||
{
|
||||
return (new Validator())->isObjectValid($this);
|
||||
}
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user