<?php
namespace App\Entity;
use App\Entity\Traits\ImageUploadTrait;
use App\Entity\Traits\LinkTrait;
use App\Entity\Traits\MetaTrait;
use App\Entity\Traits\SubTitleTrait;
use App\Entity\Traits\TitleAndContentTrait;
use App\Entity\Traits\TranslateTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @Gedmo\Loggable
*
* @Gedmo\TranslationEntity(class="App\Entity\PagePreviewTranslations")
*/
#[ORM\Entity(repositoryClass: \App\Repository\PageRepository::class)]
#[ORM\Table(name: 'page_preview')]
class PagePreview
{
use TitleAndContentTrait;
use SubTitleTrait;
use LinkTrait;
use MetaTrait;
use ImageUploadTrait;
use TimestampableEntity;
use TranslateTrait;
#[ORM\Column(name: 'components', type: 'array', nullable: true)]
protected array $components = [];
#[ORM\Column(name: 'extraUrlsegments', type: 'array', nullable: true)]
protected array $extraUrlsegments = [];
#[ORM\Column(name: 'htmlblocks', type: 'array', nullable: true)]
protected array $htmlblocks = [];
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
/**
* @Gedmo\Translatable
*/
#[Assert\NotBlank(message: 'The menu title should not be blank')]
#[ORM\Column(name: 'navtitle', type: 'string', length: 128)]
private ?string $navtitle = null;
/**
* @Gedmo\Translatable
*/
#[ORM\Column(name: 'content', type: 'text', nullable: true)]
private ?string $content = null;
/**
* @Gedmo\Translatable
*/
#[ORM\Column(name: 'content2', type: 'text', nullable: true)]
private ?string $content2 = null;
#[ORM\Column(name: 'featured_image', type: 'string', length: 255, nullable: true)]
private ?string $featuredImage = null;
#[ORM\ManyToOne(targetEntity: \App\Entity\Page::class, inversedBy: 'pagePreviews')]
private ?Page $page = null;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set navtitle.
*
* @param string $navtitle
*
* @return PagePreview
*/
public function setNavtitle($navtitle)
{
$this->navtitle = $navtitle;
return $this;
}
/**
* Get navtitle.
*
* @return string
*/
public function getNavtitle()
{
return $this->navtitle;
}
/**
* Set content.
*
* @param string $content
*
* @return PagePreview
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
/**
* Get content.
*
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Set content2.
*
* @param string $content2
*
* @return PagePreview
*/
public function setContent2($content2)
{
$this->content2 = $content2;
return $this;
}
/**
* Get content2.
*
* @return string
*/
public function getContent2()
{
return $this->content2;
}
/**
* Set components.
*
* @param array $components
*
* @return PagePreview
*/
public function setComponents($components)
{
$this->components = $components;
return $this;
}
/**
* Get components.
*
* @return array
*/
public function getComponents()
{
return $this->components;
}
/**
* Set extraUrlsegments.
*
* @param array $extraUrlsegments
*
* @return PagePreview
*/
public function setExtraUrlsegments($extraUrlsegments)
{
$this->extraUrlsegments = $extraUrlsegments;
return $this;
}
/**
* Get extraUrlsegments.
*
* @return array
*/
public function getExtraUrlsegments()
{
return $this->extraUrlsegments;
}
/**
* Set htmlblocks.
*
* @param array $htmlblocks
*
* @return PagePreview
*/
public function setHtmlblocks($htmlblocks)
{
$this->htmlblocks = $htmlblocks;
return $this;
}
/**
* Get htmlblocks.
*
* @return array
*/
public function getHtmlblocks()
{
return $this->htmlblocks;
}
/**
* Set featuredImage.
*
* @param string $featuredImage
*
* @return PagePreview
*/
public function setFeaturedImage($featuredImage)
{
$this->featuredImage = $featuredImage;
return $this;
}
/**
* Get featuredImage.
*
* @return string
*/
public function getFeaturedImage()
{
return $this->featuredImage;
}
/**
* Set page.
*
* @return PagePreview
*/
public function setPage(Page $page = null)
{
$this->page = $page;
return $this;
}
/**
* Get page.
*
* @return \App\Entity\Page
*/
public function getPage()
{
return $this->page;
}
// REQUIRED BY THE META LINKS TRAIT - NOT REALLY NEEDED HERE BUT WHATEVS :)
public function getLinkedPageId(): int
{
return 1;
}
}