src/Entity/Pages/ContentPage.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Pages;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Kunstmaan\NodeBundle\Entity\AbstractPage;
  5. use Kunstmaan\NodeSearchBundle\Helper\SearchTypeInterface;
  6. use Kunstmaan\PagePartBundle\Helper\HasPageTemplateInterface;
  7. use Symfony\Component\Form\AbstractType;
  8. use App\Form\Pages\ContentPageAdminType;
  9. #[ORM\Entity()]
  10. #[ORM\Table(name'app_content_pages')]
  11. class ContentPage extends AbstractPage implements HasPageTemplateInterfaceSearchTypeInterface
  12. {
  13.     /**
  14.      * Returns the default backend form type for this page
  15.      *
  16.      * @return string
  17.      */
  18.     public function getDefaultAdminType()
  19.     {
  20.         return ContentPageAdminType::class;
  21.     }
  22.     /**
  23.      * @return array
  24.      */
  25.     public function getPossibleChildTypes()
  26.     {
  27.         return array (
  28.             array(
  29.                 'name'  => 'ContentPage',
  30.                 'class' => 'App\Entity\Pages\ContentPage'
  31.             ),
  32.             array(
  33.                 'name' => 'PublicationPage',
  34.                 'class'=> 'App\Entity\Pages\PublicationPage'
  35.             ),
  36.         );
  37.     }
  38.     /**
  39.      * {@inheritdoc}
  40.      */
  41.     public function getSearchType()
  42.     {
  43.         return 'Page';
  44.     }
  45.     /**
  46.      * @return string[]
  47.      */
  48.     public function getPagePartAdminConfigurations()
  49.     {
  50.         return array('main');
  51.     }
  52.     /**
  53.      * {@inheritdoc}
  54.      */
  55.     public function getPageTemplates()
  56.     {
  57.         return array('contentpage');
  58.     }
  59.     /**
  60.      * @return string
  61.      */
  62.     public function getDefaultView()
  63.     {
  64.         return 'Pages\ContentPage\view.html.twig';
  65.     }
  66. }