<?php
/**
* Created by simpson <simpsonwork@gmail.com>
* Date: 2019-03-19
* Time: 18:57
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Embeddable]
final class ApartmentsPricing
{
#[ORM\Column(name: 'apartments_one_hour_price', type: 'integer', nullable: true)]
protected ?int $oneHourPrice;
#[ORM\Column(name: 'apartments_two_hours_price', type: 'integer', nullable: true)]
protected ?int $twoHoursPrice;
#[ORM\Column(name: 'apartments_night_price', type: 'integer', nullable: true)]
protected ?int $nightPrice;
public function __construct(?int $oneHourPrice, ?int $twoHoursPrice, ?int $nightPrice)
{
$this->oneHourPrice = $oneHourPrice;
$this->twoHoursPrice = $twoHoursPrice;
$this->nightPrice = $nightPrice;
}
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;
}
}