212 lines
3.9 KiB
PHP
212 lines
3.9 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
/**
|
|
* Event
|
|
*
|
|
* @ORM\Table(name="event", indexes={
|
|
* @ORM\Index(name="idxuser", columns={"user_id", "start", "end"}),
|
|
* @ORM\Index(name="idxdate", columns={"start", "end"}),
|
|
* @ORM\Index(name="idxusertask", columns={"user_id","task_id","start", "end"}),
|
|
* })
|
|
* @ORM\Entity(repositoryClass="App\Repository\EventRepository")
|
|
*/
|
|
class Event
|
|
{
|
|
/**
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\Column(name="duration", type="decimal", scale=2)
|
|
*
|
|
*/
|
|
private $duration;
|
|
|
|
/**
|
|
* @ORM\Column(name="start", type="datetime")
|
|
*
|
|
*/
|
|
private $start;
|
|
|
|
/**
|
|
* @ORM\Column(name="end", type="datetime")
|
|
*
|
|
*/
|
|
private $end;
|
|
|
|
/**
|
|
* @ORM\Column(name="allday", type="boolean")
|
|
*
|
|
*/
|
|
private $allday;
|
|
|
|
/**
|
|
* @ORM\Column(name="externaltrip", type="boolean")
|
|
*
|
|
*/
|
|
private $externaltrip;
|
|
|
|
/**
|
|
* @ORM\Column(name="validate", type="boolean")
|
|
*
|
|
*/
|
|
private $validate;
|
|
|
|
/**
|
|
* @ORM\Column(name="validateholiday", type="boolean")
|
|
*
|
|
*/
|
|
private $validateholiday;
|
|
|
|
/**
|
|
* @ORM\Column(type="text", nullable=true)
|
|
*/
|
|
private $description;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="User", inversedBy="events")
|
|
*/
|
|
private $user;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Task", inversedBy="events")
|
|
*/
|
|
private $task;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getDuration(): ?string
|
|
{
|
|
return $this->duration;
|
|
}
|
|
|
|
public function setDuration(string $duration): self
|
|
{
|
|
$this->duration = $duration;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getStart(): ?\DateTimeInterface
|
|
{
|
|
return clone $this->start;
|
|
}
|
|
|
|
public function setStart(\DateTimeInterface $start): self
|
|
{
|
|
$this->start = clone $start;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEnd(): ?\DateTimeInterface
|
|
{
|
|
return clone $this->end;
|
|
}
|
|
|
|
public function setEnd(\DateTimeInterface $end): self
|
|
{
|
|
$this->end = clone $end;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getAllday(): ?bool
|
|
{
|
|
return $this->allday;
|
|
}
|
|
|
|
public function setAllday(bool $allday): self
|
|
{
|
|
$this->allday = $allday;
|
|
|
|
return $this;
|
|
}
|
|
public function getExternalTrip(): ?bool
|
|
{
|
|
return $this->externaltrip;
|
|
}
|
|
|
|
public function setExternalTrip(bool $externaltrip): self
|
|
{
|
|
$this->externaltrip = $externaltrip;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getValidate(): ?bool
|
|
{
|
|
return $this->validate;
|
|
}
|
|
|
|
public function setValidate(bool $validate): self
|
|
{
|
|
$this->validate = $validate;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDescription(): ?string
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
public function setDescription(?string $description): self
|
|
{
|
|
$this->description = $description;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUser(): ?User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
public function setUser(?User $user): self
|
|
{
|
|
$this->user = $user;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getTask(): ?Task
|
|
{
|
|
return $this->task;
|
|
}
|
|
|
|
public function setTask(?Task $task): self
|
|
{
|
|
$this->task = $task;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getValidateholiday(): ?bool
|
|
{
|
|
return $this->validateholiday;
|
|
}
|
|
|
|
public function setValidateholiday(bool $validateholiday): self
|
|
{
|
|
$this->validateholiday = $validateholiday;
|
|
|
|
return $this;
|
|
}
|
|
|
|
|
|
}
|