src/Entity/Workshift.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WorkshiftRepository;
  4. use DateTimeInterface;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=WorkshiftRepository::class)
  8.  * @ORM\Table(name="workshifts", indexes={
  9.  *     @ORM\Index(name="cashdesk_id", columns={"cashdesk_id"}),
  10.  *     @ORM\Index(name="user_id", columns={"user_id"}),
  11.  *     @ORM\Index(name="close_datetime", columns={"close_datetime"})
  12.  * })
  13.  */
  14. class Workshift
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private ?int $id null;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="workshifts")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private User $user;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Cashdesk::class, inversedBy="workshifts")
  29.      * @ORM\JoinColumn(nullable=false)
  30.      */
  31.     private Cashdesk $cashdesk;
  32.     /**
  33.      * @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
  34.      */
  35.     private ?DateTimeInterface $open_datetime null;
  36.     /**
  37.      * @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
  38.      */
  39.     private ?DateTimeInterface $close_datetime null;
  40.     /**
  41.      * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
  42.      */
  43.     private int $cashdesk_id 0;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getUser(): User
  49.     {
  50.         return $this->user;
  51.     }
  52.     public function setUser(User $user): self
  53.     {
  54.         $this->user $user;
  55.         return $this;
  56.     }
  57.     public function getCashdesk(): Cashdesk
  58.     {
  59.         return $this->cashdesk;
  60.     }
  61.     public function setCashdesk(Cashdesk $cashdesk): self
  62.     {
  63.         $this->cashdesk $cashdesk;
  64.         return $this;
  65.     }
  66.     public function getOpenDatetime(): ?DateTimeInterface
  67.     {
  68.         return $this->open_datetime;
  69.     }
  70.     public function setOpenDatetime(DateTimeInterface $open_datetime): self
  71.     {
  72.         $this->open_datetime $open_datetime;
  73.         return $this;
  74.     }
  75.     public function getCloseDatetime(): ?DateTimeInterface
  76.     {
  77.         return $this->close_datetime;
  78.     }
  79.     public function setCloseDatetime(?DateTimeInterface $close_datetime): self
  80.     {
  81.         $this->close_datetime $close_datetime;
  82.         return $this;
  83.     }
  84. }