src/Entity/ApartmentsPricing.php line 13

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by simpson <simpsonwork@gmail.com>
  4.  * Date: 2019-03-19
  5.  * Time: 18:57
  6.  */
  7. namespace App\Entity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Embeddable]
  10. final class ApartmentsPricing
  11. {
  12.     #[ORM\Column(name'apartments_one_hour_price'type'integer'nullabletrue)]
  13.     protected ?int $oneHourPrice;
  14.     #[ORM\Column(name'apartments_two_hours_price'type'integer'nullabletrue)]
  15.     protected ?int $twoHoursPrice;
  16.     #[ORM\Column(name'apartments_night_price'type'integer'nullabletrue)]
  17.     protected ?int $nightPrice;
  18.     public function __construct(?int $oneHourPrice, ?int $twoHoursPrice, ?int $nightPrice)
  19.     {
  20.         $this->oneHourPrice $oneHourPrice;
  21.         $this->twoHoursPrice $twoHoursPrice;
  22.         $this->nightPrice $nightPrice;
  23.     }
  24.     public function isProvided(): bool
  25.     {
  26.         return $this->oneHourPrice || $this->twoHoursPrice || $this->nightPrice;
  27.     }
  28.     public function getOneHourPrice(): ?int
  29.     {
  30.         return $this->oneHourPrice;
  31.     }
  32.     public function getTwoHoursPrice(): ?int
  33.     {
  34.         return $this->twoHoursPrice;
  35.     }
  36.     public function getNightPrice(): ?int
  37.     {
  38.         return $this->nightPrice;
  39.     }
  40. }