src/Entity/Pages/FormationsPage.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Pages;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Kunstmaan\ArticleBundle\Entity\AbstractArticlePage;
  7. use Kunstmaan\NodeSearchBundle\Helper\SearchTypeInterface;
  8. use Kunstmaan\PagePartBundle\Helper\HasPageTemplateInterface;
  9. use Kunstmaan\NodeBundle\Entity\HideSidebarInNodeEditInterface;
  10. use App\Form\Pages\FormationsPageAdminType;
  11. use Symfony\Component\Form\AbstractType;
  12. use App\Utils\Str;
  13. use App\Repository\FormationsPageRepository;
  14. #[ORM\Entity(repositoryClassFormationsPageRepository::class)]
  15. #[ORM\Table(name'app_formations_pages')]
  16. #[ORM\HasLifecycleCallbacks]
  17. class FormationsPage extends AbstractArticlePage implements HasPageTemplateInterfaceSearchTypeInterfaceHideSidebarInNodeEditInterface
  18. {
  19.     #[ORM\Column(name'admission'type:"text"nullable:true)]
  20.        protected String $admission;
  21.     #[ORM\Column(name'programme'type:"text"nullable:true)]
  22.        protected String $programme;
  23.     #[ORM\Column(name'debouche'type:"text"nullable:true)]
  24.        protected  String $debouche;
  25.     
  26.     public function __construct()
  27.     {
  28.         
  29.     }
  30.     
  31.     /**
  32.      * Returns the default backend form type for this page
  33.      *
  34.      * @return string
  35.      */
  36.     public function getDefaultAdminType()
  37.     {
  38.         return FormationsPageAdminType::class;
  39.     }
  40.     /**
  41.      * {@inheritdoc}
  42.      */
  43.     public function getSearchType()
  44.     {
  45.         return 'Formations';
  46.     }
  47.     /**
  48.      * @return array
  49.      */
  50.     public function getPagePartAdminConfigurations()
  51.     {
  52.         //return array('IUTUDCWebsiteBundle:formationsmain');
  53.         return array();
  54.     }
  55.     /**
  56.      * {@inheritdoc}
  57.      */
  58.     public function getPageTemplates()
  59.     {
  60.         return array('formationspage');
  61.     }
  62.     public function getDefaultView()
  63.     {
  64.         return 'Pages/FormationsPage/view.html.twig';
  65.     }
  66.     #[ORM\PrePersist]
  67.     public function _prePersist()
  68.     {
  69.         // Set date to now when none is set
  70.         if ($this->date == null) {
  71.             $this->setDate(new \DateTime());
  72.         }
  73.     }
  74.     
  75.     public function setAdmission($admission)
  76.     {
  77.         $this->admission $admission;
  78.         return $this;
  79.     }
  80.     public function getAdmission()
  81.     {
  82.         return $this->admission;
  83.     }
  84.     public function setProgramme($programme)
  85.     {
  86.         $this->programme $programme;
  87.         return $this;
  88.     }
  89.     public function getProgramme()
  90.     {
  91.         return $this->programme;
  92.     }
  93.     public function setDebouche($debouche)
  94.     {
  95.         $this->debouche $debouche;
  96.         return $this;
  97.     }
  98.     public function getDebouche()
  99.     {
  100.         return $this->debouche;
  101.     }
  102.     public function getUri()
  103.     {
  104.         return Str::slug($this->getTitle());
  105.     }
  106. }