72 lines
1.4 KiB
PHP
72 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\AssignmentRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: AssignmentRepository::class)]
|
|
#[ORM\UniqueConstraint(
|
|
columns: ['employee', 'ride']
|
|
)]
|
|
class Assignment
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\ManyToOne(targetEntity: Employee::class, inversedBy: 'assignments')]
|
|
#[ORM\Column(type: 'integer')]
|
|
private ?Employee $employee = null;
|
|
|
|
#[ORM\Id]
|
|
#[ORM\ManyToOne(targetEntity: Ride::class, inversedBy: 'assignments')]
|
|
#[ORM\Column(type: 'integer')]
|
|
private ?Ride $ride = null;
|
|
|
|
#[ORM\Column]
|
|
private ?\DateTime $startHour = null;
|
|
|
|
#[ORM\Column]
|
|
private ?\DateTime $endHour = null;
|
|
|
|
public function getStartHour(): ?\DateTime
|
|
{
|
|
return $this->startHour;
|
|
}
|
|
|
|
public function getEmployee(): ?Employee
|
|
{
|
|
return $this->employee;
|
|
}
|
|
|
|
public function setEmployee(?Employee $employee): void
|
|
{
|
|
$this->employee = $employee;
|
|
}
|
|
|
|
public function getRide(): ?Ride
|
|
{
|
|
return $this->ride;
|
|
}
|
|
|
|
public function setRide(?Ride $ride): void
|
|
{
|
|
$this->ride = $ride;
|
|
}
|
|
|
|
public function setStartHour(?\DateTime $startHour): void
|
|
{
|
|
$this->startHour = $startHour;
|
|
}
|
|
|
|
public function getEndHour(): ?\DateTime
|
|
{
|
|
return $this->endHour;
|
|
}
|
|
|
|
public function setEndHour(?\DateTime $endHour): void
|
|
{
|
|
$this->endHour = $endHour;
|
|
}
|
|
|
|
|
|
}
|