Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <?php
  2. declare(strict_types=1);
  3.  
  4. namespace App\Sitter\Domain\ValueObject;
  5.  
  6. final class Sitter
  7. {
  8.     private $id;
  9.     private $status;
  10.     private $firstname;
  11.     private $lastname;
  12.     private $email;
  13.     private $phone;
  14.     private $second_phone;
  15.     private $city;
  16.  
  17.     public function __construct(
  18.         int $id,
  19.         string $status,
  20.         ?string $firstname,
  21.         ?string $lastname,
  22.         ?string $email,
  23.         ?string $phone,
  24.         ?string $second_phone,
  25.         ?string $city
  26.     ) {
  27.         $this->id = $id;
  28.         $this->status = $status;
  29.         $this->firstname = $firstname;
  30.         $this->lastname = $lastname;
  31.         $this->email = $email;
  32.         $this->phone = $phone;
  33.         $this->second_phone = $second_phone;
  34.         $this->city = $city;
  35.     }
  36.  
  37.     public function getId(): int
  38.     {
  39.         return $this->id;
  40.     }
  41.  
  42.     public function getStatus(): string
  43.     {
  44.         return $this->status;
  45.     }
  46.  
  47.     public function getFirstName(): ?string
  48.     {
  49.         return $this->firstname;
  50.     }
  51.  
  52.     public function getLastName(): ?string
  53.     {
  54.         return $this->lastname;
  55.     }
  56.  
  57.     public function getEmail(): ?string
  58.     {
  59.         return $this->email;
  60.     }
  61.  
  62.     public function getPhone(): ?string
  63.     {
  64.         return $this->phone;
  65.     }
  66.  
  67.     public function getSecondPhone(): ?string
  68.     {
  69.         return $this->second_phone;
  70.     }
  71.  
  72.     public function getCity(): ?string
  73.     {
  74.         return $this->city;
  75.     }
  76.  
  77.     public function toArray()
  78.     {
  79.         return [
  80.             'id' => $this->getId(),
  81.             'status' => $this->getStatus(),
  82.             'firstname' => $this->getFirstName(),
  83.             'lastname' => $this->getLastName(),
  84.             'email' => $this->getEmail(),
  85.             'phone' => $this->getPhone(),
  86.             'second_phone' => $this->getSecondPhone(),
  87.             'city' => $this->getCity(),
  88.         ];
  89.     }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement