<?php
/**
* Created by simpson <simpsonwork@gmail.com>
* Date: 2019-03-19
* Time: 19:17
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Embeddable]
final class TakeOutPricing
{
#[ORM\Column(name: 'take_out_one_hour_price', type: 'integer', nullable: true)]
protected ?int $oneHourPrice;
#[ORM\Column(name: 'take_out_two_hours_price', type: 'integer', nullable: true)]
protected ?int $twoHoursPrice;
#[ORM\Column(name: 'take_out_night_price', type: 'integer', nullable: true)]
protected ?int $nightPrice;
/** @var int[] */
#[ORM\Column(name: 'take_out_locations', type: 'simple_array', nullable: true)]
protected ?array $locations;
public function __construct(?int $oneHourPrice, ?int $twoHoursPrice, ?int $nightPrice, array $locations)
{
$this->oneHourPrice = $oneHourPrice;
$this->twoHoursPrice = $twoHoursPrice;
$this->nightPrice = $nightPrice;
$this->locations = $locations;
}
public function isProvided(): bool
{
return $this->oneHourPrice || $this->twoHoursPrice || $this->nightPrice;
}
public function getOneHourPrice(): ?int
{
return $this->oneHourPrice;
}
public function getTwoHoursPrice(): ?int
{
return $this->twoHoursPrice;
}
public function getNightPrice(): ?int
{
return $this->nightPrice;
}
/**
* @return int[]
*/
public function getLocations(): ?array
{
return $this->locations;
}
}