src/Entity/PageParts/ContentBoxPagePart.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\PageParts;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Kunstmaan\MediaBundle\Entity\Media;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[ORM\Entity]
  8. #[ORM\Table(name'app_content_box_page_parts')]
  9. class ContentBoxPagePart extends \Kunstmaan\PagePartBundle\Entity\AbstractPagePart
  10. {
  11.     /**
  12.      * @var string
  13.      *
  14.      * @ORM\Column(name="image_alt_text", type="text", nullable=true)
  15.      */
  16.     private $imageAltText;
  17.     #[Assert\NotBlank]
  18.        #[ORM\Column(name'intro'type'text')]
  19.        private $intro;
  20.     #[Assert\NotBlank]
  21.        #[ORM\Column(name'content'type'text')]
  22.        private $content;
  23.     #[Assert\NotNull]
  24.        #[ORM\ManyToOne(targetEntityMedia::class)]
  25.        #[ORM\JoinColumn(name'image_id'referencedColumnName'id')]
  26.        private $image;
  27.     /**
  28.      * Set imageAltText
  29.      *
  30.      * @param string $imageAltText
  31.      *
  32.      * @return ContentBoxPagePart
  33.      */
  34.     public function setImageAltText($imageAltText)
  35.     {
  36.         $this->imageAltText $imageAltText;
  37.         return $this;
  38.     }
  39.     /**
  40.      * Get imageAltText
  41.      *
  42.      * @return string
  43.      */
  44.     public function getImageAltText()
  45.     {
  46.         return $this->imageAltText;
  47.     }
  48.     /**
  49.      * Set intro
  50.      *
  51.      * @param string $intro
  52.      *
  53.      * @return ContentBoxPagePart
  54.      */
  55.     public function setIntro($intro)
  56.     {
  57.         $this->intro $intro;
  58.         return $this;
  59.     }
  60.     /**
  61.      * Get intro
  62.      *
  63.      * @return string
  64.      */
  65.     public function getIntro()
  66.     {
  67.         return $this->intro;
  68.     }
  69.     /**
  70.      * Set content
  71.      *
  72.      * @param string $content
  73.      *
  74.      * @return ContentBoxPagePart
  75.      */
  76.     public function setContent($content)
  77.     {
  78.         $this->content $content;
  79.         return $this;
  80.     }
  81.     /**
  82.      * Get content
  83.      *
  84.      * @return string
  85.      */
  86.     public function getContent()
  87.     {
  88.         return $this->content;
  89.     }
  90.     /**
  91.      * Set image
  92.      *
  93.      * @param \Kunstmaan\MediaBundle\Entity\Media $image
  94.      *
  95.      * @return ContentBoxPagePart
  96.      */
  97.     public function setImage(\Kunstmaan\MediaBundle\Entity\Media $image null)
  98.     {
  99.         $this->image $image;
  100.         return $this;
  101.     }
  102.     /**
  103.      * Get image
  104.      *
  105.      * @return \Kunstmaan\MediaBundle\Entity\Media
  106.      */
  107.     public function getImage()
  108.     {
  109.         return $this->image;
  110.     }
  111.     /**
  112.      * Get the twig view.
  113.      *
  114.      * @return string
  115.      */
  116.     public function getDefaultView()
  117.     {
  118.         return 'PageParts\ContentBoxPagePart\view.html.twig';
  119.     }
  120.     /**
  121.      * Get the admin form type.
  122.      *
  123.      * @return string
  124.      */
  125.     public function getDefaultAdminType()
  126.     {
  127.         return \App\Form\PageParts\ContentBoxPagePartAdminType::class;
  128.     }
  129. }