<?php
namespace App\Entity;
use App\Repository\OrauxRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OrauxRepository::class)]
class Oraux
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(type: 'date', nullable: true)]
private ?\DateTimeInterface $date = null;
#[ORM\OneToMany(targetEntity: Profile::class, mappedBy: 'oraux')]
#[ORM\OrderBy(['id' => 'DESC'])]
private Collection $profiles;
#[ORM\Column(type: 'time', nullable: true)]
private ?\DateTimeInterface $hour = null;
public function __construct()
{
$this->profiles = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
/**
* @return Collection<int, Profile>
*/
public function getProfiles(): Collection
{
return $this->profiles;
}
public function addProfile(Profile $profile): self
{
if (!$this->profiles->contains($profile)) {
$this->profiles[] = $profile;
$profile->setOraux($this);
}
return $this;
}
public function removeProfile(Profile $profile): self
{
if ($this->profiles->removeElement($profile)) {
// set the owning side to null (unless already changed)
if ($profile->getOraux() === $this) {
$profile->setOraux(null);
}
}
return $this;
}
public function getHour(): ?\DateTimeInterface
{
return $this->hour;
}
public function setHour(?\DateTimeInterface $hour): self
{
$this->hour = $hour;
return $this;
}
}