src/Entity/Saloon/WorkingHours.php line 14

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by simpson <simpsonwork@gmail.com>
  4.  * Date: 2019-04-16
  5.  * Time: 19:02
  6.  */
  7. namespace App\Entity\Saloon;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. #[ORM\Embeddable]
  11. final class WorkingHours
  12. {
  13.     #[ORM\Column(name'since'type'time_immutable'nullabletrue)]
  14.     #[Groups(['preview''listing'])]
  15.     protected ?\DateTimeImmutable $since;
  16.     #[ORM\Column(name'till'type'time_immutable'nullabletrue)]
  17.     #[Groups(['preview''listing'])]
  18.     protected ?\DateTimeImmutable $till;
  19.     public function __construct(?\DateTimeImmutable $since, ?\DateTimeImmutable $till)
  20.     {
  21.         $this->since $since;
  22.         $this->till $till;
  23.     }
  24.     public function getSince(): ?\DateTimeImmutable
  25.     {
  26.         return $this->since;
  27.     }
  28.     public function getTill(): ?\DateTimeImmutable
  29.     {
  30.         return $this->till;
  31.     }
  32. }