src/Entity/Oraux.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrauxRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOrauxRepository::class)]
  8. class Oraux
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private ?string $name null;
  16.     #[ORM\Column(type'date'nullabletrue)]
  17.     private ?\DateTimeInterface $date null;
  18.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'oraux')]
  19.     #[ORM\OrderBy(['id' => 'DESC'])]
  20.     private Collection $profiles;
  21.     #[ORM\Column(type'time'nullabletrue)]
  22.     private ?\DateTimeInterface $hour null;
  23.     public function __construct()
  24.     {
  25.         $this->profiles = new ArrayCollection();
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getName(): ?string
  32.     {
  33.         return $this->name;
  34.     }
  35.     public function setName(?string $name): self
  36.     {
  37.         $this->name $name;
  38.         return $this;
  39.     }
  40.     public function getDate(): ?\DateTimeInterface
  41.     {
  42.         return $this->date;
  43.     }
  44.     public function setDate(?\DateTimeInterface $date): self
  45.     {
  46.         $this->date $date;
  47.         return $this;
  48.     }
  49.     /**
  50.      * @return Collection<int, Profile>
  51.      */
  52.     public function getProfiles(): Collection
  53.     {
  54.         return $this->profiles;
  55.     }
  56.     public function addProfile(Profile $profile): self
  57.     {
  58.         if (!$this->profiles->contains($profile)) {
  59.             $this->profiles[] = $profile;
  60.             $profile->setOraux($this);
  61.         }
  62.         return $this;
  63.     }
  64.     public function removeProfile(Profile $profile): self
  65.     {
  66.         if ($this->profiles->removeElement($profile)) {
  67.             // set the owning side to null (unless already changed)
  68.             if ($profile->getOraux() === $this) {
  69.                 $profile->setOraux(null);
  70.             }
  71.         }
  72.         return $this;
  73.     }
  74.     public function getHour(): ?\DateTimeInterface
  75.     {
  76.         return $this->hour;
  77.     }
  78.     public function setHour(?\DateTimeInterface $hour): self
  79.     {
  80.         $this->hour $hour;
  81.         return $this;
  82.     }
  83. }