Updated PhotoSize
This commit is contained in:
parent
0a91098f98
commit
b19ed2f36d
1 changed files with 13 additions and 34 deletions
|
@ -7,30 +7,11 @@
|
||||||
|
|
||||||
class PhotoSize implements ObjectTypeInterface
|
class PhotoSize implements ObjectTypeInterface
|
||||||
{
|
{
|
||||||
/**
|
private string $file_id;
|
||||||
* @var string
|
private string $file_unique_id;
|
||||||
*/
|
private string $width;
|
||||||
private $file_id;
|
private string $height;
|
||||||
|
private ?int $file_size;
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $file_unique_id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $width;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $height;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int|null
|
|
||||||
*/
|
|
||||||
private $file_size;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier for this file, which can be used to download or reuse the file
|
* Identifier for this file, which can be used to download or reuse the file
|
||||||
|
@ -85,9 +66,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array representation of the object
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
|
@ -101,16 +80,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an object from an array representation
|
* @inheritDoc
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
* @return PhotoSize
|
|
||||||
* @noinspection DuplicatedCode
|
|
||||||
*/
|
*/
|
||||||
public static function fromArray(array $data): self
|
public static function fromArray(?array $data): ?PhotoSize
|
||||||
{
|
{
|
||||||
$object = new self();
|
if($data === null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$object = new self();
|
||||||
$object->file_id = $data['file_id'] ?? null;
|
$object->file_id = $data['file_id'] ?? null;
|
||||||
$object->file_unique_id = $data['file_unique_id'] ?? null;
|
$object->file_unique_id = $data['file_unique_id'] ?? null;
|
||||||
$object->width = $data['width'] ?? null;
|
$object->width = $data['width'] ?? null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue