| @@ 7-48 (lines=42) @@ | ||
| 4 | ||
| 5 | namespace Kerox\Messenger\Model\Common\Button\Payment; |
|
| 6 | ||
| 7 | class PriceList implements \JsonSerializable |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var string |
|
| 11 | */ |
|
| 12 | protected $label; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | protected $amount; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * PriceList constructor. |
|
| 21 | */ |
|
| 22 | public function __construct(string $label, string $amount) |
|
| 23 | { |
|
| 24 | $this->label = $label; |
|
| 25 | $this->amount = $amount; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return \Kerox\Messenger\Model\Common\Button\Payment\PriceList |
|
| 30 | */ |
|
| 31 | public static function create(string $label, string $amount): self |
|
| 32 | { |
|
| 33 | return new self($label, $amount); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function toArray(): array |
|
| 37 | { |
|
| 38 | return [ |
|
| 39 | 'label' => $this->label, |
|
| 40 | 'amount' => $this->amount, |
|
| 41 | ]; |
|
| 42 | } |
|
| 43 | ||
| 44 | public function jsonSerialize(): array |
|
| 45 | { |
|
| 46 | return $this->toArray(); |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| @@ 7-48 (lines=42) @@ | ||
| 4 | ||
| 5 | namespace Kerox\Messenger\Model\ProfileSettings; |
|
| 6 | ||
| 7 | class IceBreakers implements \JsonSerializable |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var string |
|
| 11 | */ |
|
| 12 | protected $question; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | protected $payload; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * IceBreakers constructor. |
|
| 21 | */ |
|
| 22 | public function __construct(string $question, string $payload) |
|
| 23 | { |
|
| 24 | $this->question = $question; |
|
| 25 | $this->payload = $payload; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return \Kerox\Messenger\Model\ProfileSettings\IceBreakers |
|
| 30 | */ |
|
| 31 | public static function create(string $question, string $payload): self |
|
| 32 | { |
|
| 33 | return new self($question, $payload); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function toArray(): array |
|
| 37 | { |
|
| 38 | return [ |
|
| 39 | 'question' => $this->question, |
|
| 40 | 'payload' => $this->payload, |
|
| 41 | ]; |
|
| 42 | } |
|
| 43 | ||
| 44 | public function jsonSerialize(): array |
|
| 45 | { |
|
| 46 | return $this->toArray(); |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||