<?php
namespace App\Entity;
use App\Repository\WorkshiftRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=WorkshiftRepository::class)
* @ORM\Table(name="workshifts", indexes={
* @ORM\Index(name="cashdesk_id", columns={"cashdesk_id"}),
* @ORM\Index(name="user_id", columns={"user_id"}),
* @ORM\Index(name="close_datetime", columns={"close_datetime"})
* })
*/
class Workshift
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="workshifts")
* @ORM\JoinColumn(nullable=false)
*/
private User $user;
/**
* @ORM\ManyToOne(targetEntity=Cashdesk::class, inversedBy="workshifts")
* @ORM\JoinColumn(nullable=false)
*/
private Cashdesk $cashdesk;
/**
* @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
*/
private ?DateTimeInterface $open_datetime = null;
/**
* @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
*/
private ?DateTimeInterface $close_datetime = null;
/**
* @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
*/
private int $cashdesk_id = 0;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): User
{
return $this->user;
}
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
public function getCashdesk(): Cashdesk
{
return $this->cashdesk;
}
public function setCashdesk(Cashdesk $cashdesk): self
{
$this->cashdesk = $cashdesk;
return $this;
}
public function getOpenDatetime(): ?DateTimeInterface
{
return $this->open_datetime;
}
public function setOpenDatetime(DateTimeInterface $open_datetime): self
{
$this->open_datetime = $open_datetime;
return $this;
}
public function getCloseDatetime(): ?DateTimeInterface
{
return $this->close_datetime;
}
public function setCloseDatetime(?DateTimeInterface $close_datetime): self
{
$this->close_datetime = $close_datetime;
return $this;
}
}