forked from mallgroup/mpapi-client-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLabel.php
45 lines (35 loc) · 833 Bytes
/
Label.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php declare(strict_types=1);
namespace MpApiClient\Label\Entity;
use JsonSerializable;
use MpApiClient\Common\Util\JsonSerializeEntityTrait;
final class Label implements JsonSerializable
{
use JsonSerializeEntityTrait;
private string $id;
private string $title;
private function __construct(string $id, string $title)
{
$this->id = $id;
$this->title = $title;
}
/**
* @param array<string, mixed> $data
*
* @internal
*/
public static function createFromApi(array $data): self
{
return new self(
(string) $data['id'],
(string) $data['title'],
);
}
public function getId(): string
{
return $this->id;
}
public function getTitle(): string
{
return $this->title;
}
}