src/Entity/Training/Planline.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Training;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\Training\PlanlineRepository;
  5. use App\Traits\Actions;
  6. use App\Entity\Training\Module;
  7. use App\Entity\Training\Planning;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassPlanlineRepository::class)]
  10. #[ORM\Table(name'hs_tc_training_planline')]
  11. #[ApiResource]
  12. class Planline implements \Stringable
  13. {
  14.     use Actions;
  15.     #[ORM\ManyToOne(targetEntity"Planning"inversedBy"planlines")]
  16.     #[ORM\JoinColumn(nullabletrue)]
  17.     private Planning $planning;
  18.     #[ORM\ManyToOne(targetEntity"Module")]
  19.     #[ORM\JoinColumn(nullabletrue)]
  20.     private Module $module;
  21.     #[ORM\Column(name"hourly"type"string"length255nullabletrue)]
  22.     private string $hourly;
  23.     #[ORM\Column(name"term"type"string"length255nullabletrue)]
  24.     private string $term;
  25.     #[ORM\Column(name"take_at"type"datetime"nullabletrue)]
  26.     private \DateTime $takeAt;
  27.     public function __construct()
  28.     {
  29.         // date_default_timezone_set('Africa/Casablanca');
  30.         $this->createAt=new \DateTime('now');
  31.         $this->published=true;
  32.     }
  33.     /**
  34.      * @return Planning
  35.      */
  36.     public function getPlanning(): ?Planning
  37.     {
  38.         return $this->planning;
  39.     }
  40.     /**
  41.      * @param Planning $planning
  42.      */
  43.     public function setPlanning(?Planning $planning): Planline
  44.     {
  45.         $this->planning $planning;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Module
  50.      */
  51.     public function getModule(): ?Module
  52.     {
  53.         return $this->module;
  54.     }
  55.     /**
  56.      * @param Module $module
  57.      */
  58.     public function setModule(?Module $module): Planline
  59.     {
  60.         $this->module $module;
  61.         return $this;
  62.     }
  63.     /**
  64.      * @return string
  65.      */
  66.     public function getEvent(): ?string
  67.     {
  68.         return $this->event;
  69.     }
  70.     /**
  71.      * @param string $event
  72.      */
  73.     public function setEvent(?string $event): Planline
  74.     {
  75.         $this->event $event;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return \DateTime
  80.      */
  81.     public function getTakeAt(): ?\DateTime
  82.     {
  83.         return $this->takeAt;
  84.     }
  85.     /**
  86.      * @param \DateTime $takeAt
  87.      */
  88.     public function setTakeAt(?\DateTime $takeAt): Planline
  89.     {
  90.         $this->takeAt $takeAt;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return string
  95.      */
  96.     public function getHourly(): ?string
  97.     {
  98.         return $this->hourly;
  99.     }
  100.     /**
  101.      * @param string $hourly
  102.      */
  103.     public function setHourly(?string $hourly): Planline
  104.     {
  105.         $this->hourly $hourly;
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return string
  110.      */
  111.     public function getTerm(): ?string
  112.     {
  113.         return $this->term;
  114.     }
  115.     /**
  116.      * @param string $term
  117.      */
  118.     public function setTerm(?string $term): Planline
  119.     {
  120.         $this->term $term;
  121.         return $this;
  122.     }
  123.     public function __toString(): string
  124.     {
  125.         return $this->module.' '.$this->planning;
  126.     }
  127. }