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.     private $notify=0;
  34.     /**
  35.      * @Assert\Url(
  36.      *     relativeProtocol = true
  37.      * )
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $link;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $slug;
  45.     /**
  46.      * @ORM\Column(type="string", nullable=true)
  47.      */
  48.     private $items;
  49.     /**
  50.      * @ORM\Column(type="text", nullable=true)
  51.      */
  52.     private $users;
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity=User::class,inversedBy="formation")
  55.      * @ORM\JoinColumn(name="owner_id",referencedColumnName="id",onDelete="CASCADE",nullable=false)
  56.      */
  57.     private $owner;
  58.     /**
  59.      * @ORM\Column(type="boolean", nullable=false, options={"default":0})
  60.      */
  61.     private $published false;
  62.     /**
  63.      * @ORM\OneToMany(targetEntity="App\Entity\FormationRegistration", mappedBy="formation",cascade={"remove"} )
  64.      *
  65.      */
  66.     private $registration;
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getTitle(): ?string
  72.     {
  73.         return $this->title;
  74.     }
  75.     public function setTitle(string $title): self
  76.     {
  77.         $this->title $title;
  78.         return $this;
  79.     }
  80.     public function getContent(): ?string
  81.     {
  82.         return $this->content;
  83.     }
  84.     public function setContent(string $content): self
  85.     {
  86.         $this->content $content;
  87.         return $this;
  88.     }
  89.     public function getLink(): ?string
  90.     {
  91.         return $this->link;
  92.     }
  93.     public function setLink(string $link): self
  94.     {
  95.         $this->link $link;
  96.         return $this;
  97.     }
  98.     public function getSlug(): ?string
  99.     {
  100.         return $this->slug;
  101.     }
  102.     public function setSlug(string $slug): self
  103.     {
  104.         $this->slug $slug;
  105.         return $this;
  106.     }
  107.     public function getItems(): ?string
  108.     {
  109.         return $this->items;
  110.     }
  111.     public function setItems(string $items): self
  112.     {
  113.         $this->items $items;
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return mixed
  118.      */
  119.     public function getOwner()
  120.     {
  121.         return $this->owner;
  122.     }
  123.     /**
  124.      * @param mixed $owner
  125.      */
  126.     public function setOwner($owner): void
  127.     {
  128.         $this->owner $owner;
  129.     }
  130.     /**
  131.      * @return bool
  132.      */
  133.     public function isPublished(): bool
  134.     {
  135.         return $this->published;
  136.     }
  137.     /**
  138.      * @param bool $published
  139.      */
  140.     public function setPublished(bool $published): void
  141.     {
  142.         $this->published $published;
  143.     }
  144.     /**
  145.      * @return mixed
  146.      */
  147.     public function getUsers()
  148.     {
  149.         return $this->users;
  150.     }
  151.     /**
  152.      * @param mixed $users
  153.      */
  154.     public function setUsers($users): void
  155.     {
  156.         $this->users $users;
  157.     }
  158.     /**
  159.      * @return int
  160.      */
  161.     public function getNotify(): bool
  162.     {
  163.         return $this->notify;
  164.     }
  165.     /**
  166.      * @param int $notify
  167.      */
  168.     public function setNotify(int $notify): void
  169.     {
  170.         $this->notify $notify;
  171.     }
  172. }