| 1 | <?php |
||
| 7 | class Chat |
||
| 8 | { |
||
| 9 | public const TYPE_PRIVATE = 'private'; |
||
| 10 | public const TYPE_GROUP = 'group'; |
||
| 11 | |||
| 12 | private $id; |
||
| 13 | private $title; |
||
| 14 | private $type; |
||
| 15 | |||
| 16 | 30 | protected function __construct(string $id, string $title = null, string $type = self::TYPE_PRIVATE) |
|
| 22 | |||
| 23 | 30 | public static function make(string $id, string $title = null, string $type = self::TYPE_PRIVATE) |
|
| 24 | { |
||
| 25 | 30 | return new static($id, $title, $type); |
|
| 26 | } |
||
| 27 | |||
| 28 | 3 | public function getId(): string |
|
| 32 | |||
| 33 | 1 | public function getTitle(): ?string |
|
| 37 | |||
| 38 | 1 | public function getType(): string |
|
| 42 | } |
||
| 43 |