vasildakov /
speedy
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace VasilDakov\Speedy\Service\Location\Office; |
||
| 6 | |||
| 7 | use VasilDakov\Speedy\Property; |
||
| 8 | use VasilDakov\Speedy\Traits\ToArray; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class FindOfficeRequest. |
||
| 12 | * |
||
| 13 | * @author Vasil Dakov <[email protected]> |
||
| 14 | * @copyright 2009-2022 Neutrino.bg |
||
| 15 | * |
||
| 16 | * @version 1.0 |
||
| 17 | */ |
||
| 18 | class FindOfficeRequest |
||
| 19 | { |
||
| 20 | use ToArray; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 21 | |||
| 22 | private ?int $countryId; |
||
| 23 | 2 | ||
| 24 | private ?int $siteId; |
||
| 25 | 2 | ||
| 26 | private ?string $name; |
||
| 27 | |||
| 28 | 1 | public function __construct(?int $countryId = null, ?int $siteId = null, ?string $name = null) |
|
| 29 | { |
||
| 30 | 1 | $this->countryId = $countryId; |
|
| 31 | $this->siteId = $siteId; |
||
| 32 | $this->name = $name; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return int |
||
| 37 | */ |
||
| 38 | public function getCountryId(): int |
||
| 39 | { |
||
| 40 | return $this->countryId; |
||
|
0 ignored issues
–
show
|
|||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | public function toArray(): array |
||
| 45 | { |
||
| 46 | return [ |
||
| 47 | Property::COUNTRY_ID->value => $this->countryId, |
||
| 48 | Property::SITE_ID->value => $this->siteId, |
||
| 49 | Property::NAME->value => $this->name, |
||
| 50 | ]; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |