src/AtechNet/CoreBundle/Entity/AbstractPage.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  5. use Doctrine\ORM\Mapping\MappedSuperclass;
  6. /**
  7.  * AbstractPage
  8.  *
  9.  * @MappedSuperclass
  10.  * @HasLifecycleCallbacks
  11.  */
  12. abstract class AbstractPage extends AbstractSignedEntity
  13. {
  14.     public const TYPE_STATIC = 1;
  15.     public const TYPE_BLOG = 2;
  16.     public const TYPE_CATEGORY = 3;
  17.     /**
  18.      * @return array
  19.      */
  20.     public static function getTypeChoices()
  21.     {
  22.         return [
  23.             self::TYPE_STATIC => 'static',
  24.             self::TYPE_BLOG => 'blog',
  25.             self::TYPE_CATEGORY => 'category',
  26.         ];
  27.     }
  28.     /**
  29.      * @return array
  30.      */
  31.     public static function getEntityNameByTypeChoices()
  32.     {
  33.         return [
  34.             'static'   => 'StaticPage',
  35.             'blog'     => 'BlogPage',
  36.             'category' => 'CategoryPage',
  37.         ];
  38.     }
  39.     /**
  40.      * @var bool
  41.      *
  42.      * @Column(name="published", type="boolean")
  43.      */
  44.     private $published = false;
  45.     /**
  46.      * @var bool
  47.      *
  48.      * @Column(name="indexable", type="boolean")
  49.      */
  50.     private $indexable = true;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @Column(name="social_share_image", type="text", nullable=true)
  55.      */
  56.     private $socialShareImage;
  57.     /**
  58.      * @return bool
  59.      */
  60.     public function isPublished()
  61.     {
  62.         return $this->published;
  63.     }
  64.     /**
  65.      * @param bool $published
  66.      */
  67.     public function setPublished($published)
  68.     {
  69.         $this->published = $published;
  70.     }
  71.     /**
  72.      * @return bool
  73.      */
  74.     public function isIndexable()
  75.     {
  76.         return $this->indexable;
  77.     }
  78.     /**
  79.      * @param bool $indexable
  80.      */
  81.     public function setIndexable($indexable)
  82.     {
  83.         $this->indexable = $indexable;
  84.     }
  85.     /**
  86.      * @return string
  87.      */
  88.     public function getSocialShareImage()
  89.     {
  90.         return $this->socialShareImage;
  91.     }
  92.     /**
  93.      * @param string $socialShareImage
  94.      */
  95.     public function setSocialShareImage($socialShareImage)
  96.     {
  97.         $this->socialShareImage = $socialShareImage;
  98.     }
  99. }