src/Entity/Formation.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FormationRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FormationRepository::class)
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class Formation
  13. {
  14.     use DateTrait;
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      * @Assert\NotNull(message="Le champ titre doit ĂȘtre renseignĂ©")
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $content;
  30.     /**
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     /**
  34.      * @ORM\Column(name="is_required", type="boolean", options={"default": "0"})
  35.      */
  36.     private $isRequired false;
  37.     /**
  38.      * @Assert\Url(
  39.      *     relativeProtocol = true
  40.      * )
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $link;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      */
  47.     private $slug;
  48.     /**
  49.      * @ORM\Column(type="string", nullable=true)
  50.      */
  51.     private $items;
  52.     /**
  53.      * @ORM\Column(type="text", nullable=true)
  54.      */
  55.     private $users;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="ownedFormations")
  58.      * @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="CASCADE", nullable=false)
  59.      */
  60.     private $owner;
  61.     /**
  62.      * @ORM\Column(type="boolean", nullable=false, options={"default":0})
  63.      */
  64.     private $published false;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity="App\Entity\FormationRegistration", mappedBy="formation",cascade={"remove"} )
  67.      *
  68.      */
  69.     private $registration;
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getTitle(): ?string
  75.     {
  76.         return $this->title;
  77.     }
  78.     public function setTitle(string $title): self
  79.     {
  80.         $this->title $title;
  81.         return $this;
  82.     }
  83.     public function getContent(): ?string
  84.     {
  85.         return $this->content;
  86.     }
  87.     public function setContent(string $content): self
  88.     {
  89.         $this->content $content;
  90.         return $this;
  91.     }
  92.     public function getLink(): ?string
  93.     {
  94.         return $this->link;
  95.     }
  96.     public function setLink(string $link): self
  97.     {
  98.         $this->link $link;
  99.         return $this;
  100.     }
  101.     public function getSlug(): ?string
  102.     {
  103.         return $this->slug;
  104.     }
  105.     public function setSlug(string $slug): self
  106.     {
  107.         $this->slug $slug;
  108.         return $this;
  109.     }
  110.     public function getItems(): ?string
  111.     {
  112.         return $this->items;
  113.     }
  114.     public function setItems(string $items): self
  115.     {
  116.         $this->items $items;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return mixed
  121.      */
  122.     public function getOwner()
  123.     {
  124.         return $this->owner;
  125.     }
  126.     /**
  127.      * @param mixed $owner
  128.      */
  129.     public function setOwner($owner): void
  130.     {
  131.         $this->owner $owner;
  132.     }
  133.     /**
  134.      * @return bool
  135.      */
  136.     public function isPublished(): bool
  137.     {
  138.         return $this->published;
  139.     }
  140.     /**
  141.      * @param bool $published
  142.      */
  143.     public function setPublished(bool $published): void
  144.     {
  145.         $this->published $published;
  146.     }
  147.     /**
  148.      * @return mixed
  149.      */
  150.     public function getUsers()
  151.     {
  152.         return $this->users;
  153.     }
  154.     /**
  155.      * @param mixed $users
  156.      */
  157.     public function setUsers($users): void
  158.     {
  159.         $this->users $users;
  160.     }
  161.     /**
  162.      * @return int
  163.      */
  164.     public function isRequired(): bool
  165.     {
  166.         return $this->isRequired;
  167.     }
  168.     /**
  169.      * @param bool $isRequired
  170.      */
  171.     public function setIsRequired(bool $isRequired): void
  172.     {
  173.         $this->isRequired $isRequired;
  174.     }
  175. }