src/Entity/TakeOutPricing.php line 13

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