src/Entity/Articles/ArticlesHasCategories.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use Doctrine\DBAL\Types\Types;
  4. use Symfony\Component\Serializer\Annotation\Groups;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use App\Repository\Articles\ArticlesHasCategoriesRepository;
  11. use Symfony\Component\HttpFoundation\File\UploadedFile;
  12. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  13. /**
  14.  * Articles
  15.  *
  16.  * @ORM\Table("articles_articles_has_categories")
  17.  * @ORM\Entity(repositoryClass=ArticlesHasCategoriesRepository::class)
  18.  * @ORM\HasLifecycleCallbacks()
  19.  */
  20. class ArticlesHasCategories {
  21.     /**
  22.      * @var integer
  23.      *
  24.      * @ORM\Column(name="id", type="integer")
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="AUTO")
  27.      * [Groups(['list', 'item'])]
  28.      */
  29.     protected $id;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  34.      */
  35.     private $createdAt;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  40.      */
  41.     private $updatedAt;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="title", type="string", length=500, nullable=true)
  46.      */
  47.     private $title;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="titleMenu", type="string", length=500, nullable=true)
  52.      */
  53.     private $titleMenu;
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="titlePage", type="string", length=500, nullable=true)
  58.      */
  59.     private $titlePage;
  60.     /**
  61.      * @var string
  62.      *
  63.      * @ORM\Column(name="identifiant", type="string", length=500, nullable=true)
  64.      */
  65.     private $identifiant;
  66.     /**
  67.      * @var string
  68.      *
  69.      * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  70.      */
  71.     private $slug;
  72.     /**
  73.      * @var string
  74.      *
  75.      * @ORM\Column(name="shortTitle", type="string", length=500, nullable=true)
  76.      */
  77.     private $shortTitle;
  78.     /**
  79.      * @var string
  80.      *
  81.      * @ORM\Column(name="short_description", type="text", nullable=true)
  82.      */
  83.     private $shortDescription;
  84.     /**
  85.      * @var string
  86.      *
  87.      * @ORM\Column(name="top_description", type="text", nullable=true)
  88.      */
  89.     private $topDescription;
  90.     /**
  91.      * @var string
  92.      *
  93.      * @ORM\Column(name="bottom_description", type="text", nullable=true)
  94.      */
  95.     private $bottomDescription;
  96.     /**
  97.      * @var string
  98.      *
  99.      * @ORM\Column(name="locale", type="string", length=11, nullable=true)
  100.      */
  101.     private $locale;
  102.     /**
  103.      * @var \ArticlesHasCategories
  104.      *
  105.      * @ORM\ManyToOne(targetEntity="ArticlesHasCategories")
  106.      * @ORM\JoinColumns({
  107.      *   @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
  108.      * })
  109.      */
  110.     protected $category;
  111.     /**
  112.      * @var string
  113.      *
  114.      * @ORM\Column(name="parent", type="boolean", nullable=true)
  115.      */
  116.     private $parent;
  117.     /**
  118.      * @var string
  119.      *
  120.      * @ORM\Column(name="recruiterDirectory", type="boolean", nullable=true)
  121.      */
  122.     private $recruiterDirectory;
  123.     /**
  124.      * @var string
  125.      *
  126.      * @ORM\Column(name="employerDirectory", type="boolean", nullable=true)
  127.      */
  128.     private $employerDirectory;
  129.     /**
  130.      * @ORM\PrePersist
  131.      */
  132.     public function setCreatedAtValue(): void
  133.     {
  134.         $this->setCreatedAt(new \DateTime("now"));
  135.         $this->setUpdatedAt(new \DateTime("now"));
  136.     }
  137.     /**
  138.      * @ORM\PreUpdate
  139.      */
  140.     public function setUpdatedAtValue(): void
  141.     {
  142.         $this->setUpdatedAt(new \DateTime("now"));
  143.     }
  144.     public function __toString()
  145.     {
  146.         $chain="";
  147.         if($this->recruiterDirectory == 1) {
  148.             $chain="[Directory Recruiter] ";
  149.         }
  150.         if($this->parent == 1) {
  151.             return $chain."PARENT: ".$this->title." (".$this->identifiant." • ".$this->locale.")";
  152.         }
  153.         return $chain.$this->title." (".$this->identifiant." • ".$this->locale.")";
  154.     }
  155.     public function getId(): ?int
  156.     {
  157.         return $this->id;
  158.     }
  159.     public function getCreatedAt(): ?\DateTimeInterface
  160.     {
  161.         return $this->createdAt;
  162.     }
  163.     public function setCreatedAt(?\DateTimeInterface $createdAt): static
  164.     {
  165.         $this->createdAt = $createdAt;
  166.         return $this;
  167.     }
  168.     public function getUpdatedAt(): ?\DateTimeInterface
  169.     {
  170.         return $this->updatedAt;
  171.     }
  172.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  173.     {
  174.         $this->updatedAt = $updatedAt;
  175.         return $this;
  176.     }
  177.     public function getTitle(): ?string
  178.     {
  179.         return $this->title;
  180.     }
  181.     public function setTitle(?string $title): static
  182.     {
  183.         $this->title = $title;
  184.         return $this;
  185.     }
  186.     public function getIdentifiant(): ?string
  187.     {
  188.         return $this->identifiant;
  189.     }
  190.     public function setIdentifiant(?string $identifiant): static
  191.     {
  192.         $this->identifiant = $identifiant;
  193.         return $this;
  194.     }
  195.     public function getSlug(): ?string
  196.     {
  197.         return $this->slug;
  198.     }
  199.     public function setSlug(?string $slug): static
  200.     {
  201.         $this->slug = $slug;
  202.         return $this;
  203.     }
  204.     public function getShortTitle(): ?string
  205.     {
  206.         return $this->shortTitle;
  207.     }
  208.     public function setShortTitle(?string $shortTitle): static
  209.     {
  210.         $this->shortTitle = $shortTitle;
  211.         return $this;
  212.     }
  213.     public function getShortDescription(): ?string
  214.     {
  215.         return $this->shortDescription;
  216.     }
  217.     public function setShortDescription(?string $shortDescription): static
  218.     {
  219.         $this->shortDescription = $shortDescription;
  220.         return $this;
  221.     }
  222.     public function getLocale(): ?string
  223.     {
  224.         return $this->locale;
  225.     }
  226.     public function setLocale(?string $locale): static
  227.     {
  228.         $this->locale = $locale;
  229.         return $this;
  230.     }
  231.     public function getCategory(): ?self
  232.     {
  233.         return $this->category;
  234.     }
  235.     public function setCategory(?self $category): static
  236.     {
  237.         $this->category = $category;
  238.         return $this;
  239.     }
  240.     public function isParent(): ?bool
  241.     {
  242.         return $this->parent;
  243.     }
  244.     public function setParent(?bool $parent): static
  245.     {
  246.         $this->parent = $parent;
  247.         return $this;
  248.     }
  249.     public function isRecruiterDirectory(): ?bool
  250.     {
  251.         return $this->recruiterDirectory;
  252.     }
  253.     public function setRecruiterDirectory(?bool $recruiterDirectory): static
  254.     {
  255.         $this->recruiterDirectory = $recruiterDirectory;
  256.         return $this;
  257.     }
  258.     public function isEmployerDirectory(): ?bool
  259.     {
  260.         return $this->employerDirectory;
  261.     }
  262.     public function setEmployerDirectory(?bool $employerDirectory): static
  263.     {
  264.         $this->employerDirectory = $employerDirectory;
  265.         return $this;
  266.     }
  267.     public function getTopDescription(): ?string
  268.     {
  269.         return $this->topDescription;
  270.     }
  271.     public function setTopDescription(?string $topDescription): static
  272.     {
  273.         $this->topDescription = $topDescription;
  274.         return $this;
  275.     }
  276.     public function getBottomDescription(): ?string
  277.     {
  278.         return $this->bottomDescription;
  279.     }
  280.     public function setBottomDescription(?string $bottomDescription): static
  281.     {
  282.         $this->bottomDescription = $bottomDescription;
  283.         return $this;
  284.     }
  285.     public function getTitleMenu(): ?string
  286.     {
  287.         return $this->titleMenu;
  288.     }
  289.     public function setTitleMenu(?string $titleMenu): static
  290.     {
  291.         $this->titleMenu = $titleMenu;
  292.         return $this;
  293.     }
  294.     public function getTitlePage(): ?string
  295.     {
  296.         return $this->titlePage;
  297.     }
  298.     public function setTitlePage(?string $titlePage): static
  299.     {
  300.         $this->titlePage = $titlePage;
  301.         return $this;
  302.     }
  303. }