<?php
namespace App\Entity;
use App\Repository\ReserveRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ReserveRepository", repositoryClass=ReserveRepository::class)
*/
class Reserve
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
public function getId(): ?int
{
return $this->id;
}
/**
* @ORM\ManyToOne(targetEntity=Motorcycle::class, inversedBy="reserves")
*/
private $motorcycle;
/**
* @ORM\ManyToOne(targetEntity=Client::class, inversedBy="reserves")
*/
private $client;
/**
* @ORM\Column(type="datetime")
*/
private DateTimeInterface $startDate;
/**
* @ORM\Column(type="datetime")
*/
private DateTimeInterface $endDate;
/**
* @ORM\Column(type="float", nullable=true)
*/
private ?float $amount;
/**
* @var int
*
* @ORM\Column(name="status", type="rent_status_type", nullable=true)
*/
private $status;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $notes;
public function getMotorcycle(): ?Motorcycle
{
return $this->motorcycle;
}
public function setMotorcycle( $motorcycle): void
{
$this->motorcycle = $motorcycle;
}
public function getClient()
{
return $this->client;
}
public function setClient( $client): void
{
$this->client = $client;
}
public function getStartDate(): DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(DateTimeInterface $startDate): void
{
$this->startDate = $startDate;
}
public function getEndDate(): DateTimeInterface
{
return $this->endDate->modify('+ 1 second');
}
public function setEndDate(DateTimeInterface $endDate): void
{
$this->endDate = $endDate->modify('- 1 second');
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(float $amount): void
{
$this->amount = $amount;
}
public function getStatus(): int
{
return $this->status;
}
public function setStatus(int $status): void
{
$this->status = $status;
}
public function getNotes(): ?string
{
return $this->notes;
}
public function setNotes(?string $notes): self
{
$this->notes = $notes;
return $this;
}
}