| Total Complexity | 6 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class UserProfilePhoto extends TdObject |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'userProfilePhoto'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Unique user profile photo identifier. |
||
| 20 | */ |
||
| 21 | protected string $id; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Point in time (Unix timestamp) when the photo has been added. |
||
| 25 | */ |
||
| 26 | protected int $addedDate; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Available variants of the user photo, in different sizes. |
||
| 30 | * |
||
| 31 | * @var PhotoSize[] |
||
| 32 | */ |
||
| 33 | protected array $sizes; |
||
| 34 | |||
| 35 | public function __construct(string $id, int $addedDate, array $sizes) |
||
| 36 | { |
||
| 37 | $this->id = $id; |
||
| 38 | $this->addedDate = $addedDate; |
||
| 39 | $this->sizes = $sizes; |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function fromArray(array $array): UserProfilePhoto |
||
| 43 | { |
||
| 44 | return new static( |
||
| 45 | $array['id'], |
||
| 46 | $array['added_date'], |
||
| 47 | array_map(fn ($x) => TdSchemaRegistry::fromArray($x), $array['sizes']), |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | public function typeSerialize(): array |
||
| 58 | ]; |
||
| 59 | } |
||
| 60 | |||
| 61 | public function getId(): string |
||
| 62 | { |
||
| 63 | return $this->id; |
||
| 64 | } |
||
| 65 | |||
| 66 | public function getAddedDate(): int |
||
| 69 | } |
||
| 70 | |||
| 71 | public function getSizes(): array |
||
| 74 | } |
||
| 75 | } |
||
| 76 |