<?php
namespace App\Entity\Pages;
use Doctrine\Common\Collections\ArrayCollection;use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Kunstmaan\ArticleBundle\Entity\AbstractArticlePage;
use Kunstmaan\NodeSearchBundle\Helper\SearchTypeInterface;
use Kunstmaan\PagePartBundle\Helper\HasPageTemplateInterface;
use Kunstmaan\NodeBundle\Entity\HideSidebarInNodeEditInterface;
use App\Form\Pages\FormationsPageAdminType;
use Symfony\Component\Form\AbstractType;
use App\Utils\Str;
use App\Repository\FormationsPageRepository;
#[ORM\Entity(repositoryClass: FormationsPageRepository::class)]
#[ORM\Table(name: 'app_formations_pages')]
#[ORM\HasLifecycleCallbacks]
class FormationsPage extends AbstractArticlePage implements HasPageTemplateInterface, SearchTypeInterface, HideSidebarInNodeEditInterface
{
#[ORM\Column(name: 'admission', type:"text", nullable:true)]
protected String $admission;
#[ORM\Column(name: 'programme', type:"text", nullable:true)]
protected String $programme;
#[ORM\Column(name: 'debouche', type:"text", nullable:true)]
protected String $debouche;
public function __construct()
{
}
/**
* Returns the default backend form type for this page
*
* @return string
*/
public function getDefaultAdminType()
{
return FormationsPageAdminType::class;
}
/**
* {@inheritdoc}
*/
public function getSearchType()
{
return 'Formations';
}
/**
* @return array
*/
public function getPagePartAdminConfigurations()
{
//return array('IUTUDCWebsiteBundle:formationsmain');
return array();
}
/**
* {@inheritdoc}
*/
public function getPageTemplates()
{
return array('formationspage');
}
public function getDefaultView()
{
return 'Pages/FormationsPage/view.html.twig';
}
#[ORM\PrePersist]
public function _prePersist()
{
// Set date to now when none is set
if ($this->date == null) {
$this->setDate(new \DateTime());
}
}
public function setAdmission($admission)
{
$this->admission = $admission;
return $this;
}
public function getAdmission()
{
return $this->admission;
}
public function setProgramme($programme)
{
$this->programme = $programme;
return $this;
}
public function getProgramme()
{
return $this->programme;
}
public function setDebouche($debouche)
{
$this->debouche = $debouche;
return $this;
}
public function getDebouche()
{
return $this->debouche;
}
public function getUri()
{
return Str::slug($this->getTitle());
}
}