src/Entity/UserObjectif.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserObjectifRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassUserObjectifRepository::class)]
  9. class UserObjectif
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $status null;
  17.     #[ORM\Columnnullabletrue)]
  18.     private ?float $user_poids null;
  19.     #[ORM\Columnnullabletrue)]
  20.     private ?int $user_taille null;
  21.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  22.     private ?\DateTimeInterface $date_ajout null;
  23.     #[ORM\ManyToOne(inversedBy'userObjectif')]
  24.     private ?User $user null;
  25.     #[ORM\ManyToMany(targetEntityObjectif::class, inversedBy'userObjectifs')]
  26.     /**
  27.      * @Assert\Count(min = 1, minMessage = "Occorre specificare almeno un utente destinatario")
  28.      */
  29.     private Collection $idObjectif;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $session_frequency null;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?int $session_number null;
  34.     #[ORM\Column(nullabletrue)]
  35.     private ?int $session_duration null;
  36.     #[ORM\Column(nullabletrue)]
  37.     private ?float $imc null;
  38.     public function __construct()
  39.     {
  40.         $this->idObjectif = new ArrayCollection();
  41.         $this->date_ajout = new \DateTimeImmutable();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getStatus(): ?string
  48.     {
  49.         return $this->status;
  50.     }
  51.     public function setStatus(?string $status): static
  52.     {
  53.         $this->status $status;
  54.         return $this;
  55.     }
  56.     public function getDateAjout(): ?\DateTimeInterface
  57.     {
  58.         return $this->date_ajout;
  59.     }
  60.     public function setDateAjout(\DateTimeInterface $date_ajout): static
  61.     {
  62.         $this->date_ajout $date_ajout;
  63.         return $this;
  64.     }
  65.     public function getUser(): ?User
  66.     {
  67.         return $this->user;
  68.     }
  69.     public function setUser(?User $user): static
  70.     {
  71.         $this->user $user;
  72.         return $this;
  73.     }
  74.     /**
  75.      * @return Collection<int, Objectif>
  76.      */
  77.     public function getIdObjectif(): Collection
  78.     {
  79.         return $this->idObjectif;
  80.     }
  81.     public function addIdObjectif(Objectif $idObjectif): static
  82.     {
  83.         if (!$this->idObjectif->contains($idObjectif)) {
  84.             $this->idObjectif->add($idObjectif);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeIdObjectif(Objectif $idObjectif): static
  89.     {
  90.         $this->idObjectif->removeElement($idObjectif);
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return float|null
  95.      */
  96.     public function getUserPoids(): ?float
  97.     {
  98.         return $this->user_poids;
  99.     }
  100.     /**
  101.      * @param float|null $user_poids
  102.      */
  103.     public function setUserPoids(?float $user_poids): void
  104.     {
  105.         $this->user_poids $user_poids;
  106.     }
  107.     /**
  108.      * @return int|null
  109.      */
  110.     public function getUserTaille(): ?int
  111.     {
  112.         return $this->user_taille;
  113.     }
  114.     /**
  115.      * @param int|null $user_taille
  116.      */
  117.     public function setUserTaille(?int $user_taille): void
  118.     {
  119.         $this->user_taille $user_taille;
  120.     }
  121.     /**
  122.      * @return string|null
  123.      */
  124.     public function getSessionFrequency(): ?string
  125.     {
  126.         return $this->session_frequency;
  127.     }
  128.     /**
  129.      * @param string|null $session_frequency
  130.      */
  131.     public function setSessionFrequency(?string $session_frequency): void
  132.     {
  133.         $this->session_frequency $session_frequency;
  134.     }
  135.     /**
  136.      * @return int|null
  137.      */
  138.     public function getSessionNumber(): ?int
  139.     {
  140.         return $this->session_number;
  141.     }
  142.     /**
  143.      * @param int|null $session_number
  144.      */
  145.     public function setSessionNumber(?int $session_number): void
  146.     {
  147.         $this->session_number $session_number;
  148.     }
  149.     /**
  150.      * @return int|null
  151.      */
  152.     public function getSessionDuration(): ?int
  153.     {
  154.         return $this->session_duration;
  155.     }
  156.     /**
  157.      * @param int|null $session_duration
  158.      */
  159.     public function setSessionDuration(?int $session_duration): void
  160.     {
  161.         $this->session_duration $session_duration;
  162.     }
  163.     public function getImc(): ?float
  164.     {
  165.         return $this->imc;
  166.     }
  167.     public function setImc(?float $imc): static
  168.     {
  169.         $this->imc $imc;
  170.         return $this;
  171.     }
  172. }