| 1 | <?php |
||
| 7 | * |
||
| 8 | * (c) Dev-Int Création <[email protected]>. |
||
| 9 | * |
||
| 10 | * For the full copyright and license information, please view the LICENSE |
||
| 11 | * file that was distributed with this source code. |
||
| 12 | */ |
||
| 13 | |||
| 14 | namespace Domain\Model\Common\VO; |
||
| 15 | |||
| 16 | final class ContactAddress |
||
| 17 | { |
||
| 18 | private string $address; |
||
|
|
|||
| 19 | private string $zipCode; |
||
| 20 | private string $town; |
||
| 21 | private string $country; |
||
| 22 | |||
| 23 | public function __construct(string $address, string $zipCode, string $town, string $country) |
||
| 24 | { |
||
| 25 | $this->address = $address; |
||
| 26 | $this->zipCode = $zipCode; |
||
| 27 | $this->town = $town; |
||
| 28 | $this->country = $country; |
||
| 29 | } |
||
| 30 | |||
| 31 | public static function fromString(string $address, string $zipCode, string $town, string $country): self |
||
| 32 | { |
||
| 33 | return new self($address, $zipCode, $town, $country); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getValue(): string |
||
| 37 | { |
||
| 38 | return $this->address . "\n" . $this->zipCode . ' ' . $this->town . ', ' . $this->country; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |