<?php
namespace App\Entity\Pages;
use App\Entity\Articles\Articles;
use Doctrine\DBAL\Types\Types;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Vich\UploaderBundle\Entity\File as EmbeddedFile;
/**
* Pages has blocks
*
* @ORM\Table("pages_pages_has_blocks")
* @ORM\Entity(repositoryClass="App\Repository\Pages\PagesBlocksRepository")
* @ORM\HasLifecycleCallbacks()
* @Vich\Uploadable
*/
class PagesHasBlocks
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
*/
private $createdAt;
/**
* @var string
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
*/
private $updatedAt;
/**
* @var string
*
* @ORM\Column(name="title", type="text", nullable=true)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="title_block", type="text", nullable=true)
*/
private $titleBlock;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="description_html", type="text", nullable=true)
*/
private $descriptionHTML;
/**
* @var string
*
* @ORM\Column(name="svg_html", type="text", nullable=true)
*/
private $svgHTML;
/**
* @var string
*
* @ORM\Column(name="backgroundColor", type="text", nullable=true)
*/
private $backgroundColor;
/**
* @var string
*
* @ORM\Column(name="html", type="boolean", nullable=true)
*/
private $html;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=255, nullable=true)
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="type_block", type="string", length=255, nullable=true)
*/
private $typeBlock;
/**
* @var string $sequence
*
* @ORM\Column(name="sequence", type="integer", length=11, nullable=true)
*/
protected $sequence;
/**
* @var \Pages
*
* @ORM\ManyToOne(targetEntity="Pages")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="page_id", referencedColumnName="id", nullable=true)
* })
*/
protected $page;
/**
* @var \SaveTemplates
*
* @ORM\ManyToOne(targetEntity="SaveTemplates")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="savetemplate_id", referencedColumnName="id", nullable=true)
* })
*/
protected $saveTemplate;
/**
* @var string
*
* @ORM\Column(name="style", type="text", nullable=true)
*/
private $style;
/**
* @var string
*
* @ORM\Column(name="visibility_user", type="boolean", nullable=true)
*/
private $visibilityUser;
/**
* @var string
*
* @ORM\Column(name="only_visitor", type="boolean", nullable=true)
*/
private $onlyVisitor;
/**
* @var string
*
* @ORM\Column(name="visibility_title", type="boolean", nullable=true)
*/
private $visibilityTitle;
/**
* @var string
*
* @ORM\Column(name="visibility_date", type="boolean", nullable=true)
*/
private $visibilityDate;
/**
* @var string
*
* @ORM\Column(name="start_page", type="boolean", nullable=true)
*/
private $startPage;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Vich\UploadableField(mapping="pages_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions")
*
* @var File|null
*/
private $imageFile;
/**
* @ORM\Embedded(class="Vich\UploaderBundle\Entity\File")
*
* @var EmbeddedFile
*/
private $image;
/**
* @var \Pages
*
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Articles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="article_id", referencedColumnName="id", nullable=true)
* })
*/
protected $article;
public function __construct()
{
$this->image = new \Vich\UploaderBundle\Entity\File();
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue(): void
{
$this->setCreatedAt(new \DateTime("now"));
$this->setUpdatedAt(new \DateTime("now"));
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedAtValue(): void
{
$this->setUpdatedAt(new \DateTime("now"));
}
public function __toString()
{
return $this->title;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|UploadedFile|null $imageFile
*/
public function setImageFile(?File $imageFile = null)
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->setUpdatedAt(new \DateTime("now"));
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function setImage(EmbeddedFile $image): void
{
$this->image = $image;
}
public function getImage(): ?EmbeddedFile
{
return $this->image;
}
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getTitleBlock(): ?string
{
return $this->titleBlock;
}
public function setTitleBlock(?string $titleBlock): self
{
$this->titleBlock = $titleBlock;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDescriptionHTML(): ?string
{
return $this->descriptionHTML;
}
public function setDescriptionHTML(?string $descriptionHTML): self
{
$this->descriptionHTML = $descriptionHTML;
return $this;
}
public function getSvgHTML(): ?string
{
return $this->svgHTML;
}
public function setSvgHTML(?string $svgHTML): self
{
$this->svgHTML = $svgHTML;
return $this;
}
public function getBackgroundColor(): ?string
{
return $this->backgroundColor;
}
public function setBackgroundColor(?string $backgroundColor): self
{
$this->backgroundColor = $backgroundColor;
return $this;
}
public function getHtml(): ?bool
{
return $this->html;
}
public function setHtml(?bool $html): self
{
$this->html = $html;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getTypeBlock(): ?string
{
return $this->typeBlock;
}
public function setTypeBlock(?string $typeBlock): self
{
$this->typeBlock = $typeBlock;
return $this;
}
public function getSequence(): ?int
{
return $this->sequence;
}
public function setSequence(?int $sequence): self
{
$this->sequence = $sequence;
return $this;
}
public function getStyle(): ?string
{
return $this->style;
}
public function setStyle(?string $style): self
{
$this->style = $style;
return $this;
}
public function getVisibilityUser(): ?bool
{
return $this->visibilityUser;
}
public function setVisibilityUser(?bool $visibilityUser): self
{
$this->visibilityUser = $visibilityUser;
return $this;
}
public function getOnlyVisitor(): ?bool
{
return $this->onlyVisitor;
}
public function setOnlyVisitor(?bool $onlyVisitor): self
{
$this->onlyVisitor = $onlyVisitor;
return $this;
}
public function getVisibilityTitle(): ?bool
{
return $this->visibilityTitle;
}
public function setVisibilityTitle(?bool $visibilityTitle): self
{
$this->visibilityTitle = $visibilityTitle;
return $this;
}
public function getVisibilityDate(): ?bool
{
return $this->visibilityDate;
}
public function setVisibilityDate(?bool $visibilityDate): self
{
$this->visibilityDate = $visibilityDate;
return $this;
}
public function getStartPage(): ?bool
{
return $this->startPage;
}
public function setStartPage(?bool $startPage): self
{
$this->startPage = $startPage;
return $this;
}
public function getPage(): ?Pages
{
return $this->page;
}
public function setPage(?Pages $page): self
{
$this->page = $page;
return $this;
}
public function getSaveTemplate(): ?SaveTemplates
{
return $this->saveTemplate;
}
public function setSaveTemplate(?SaveTemplates $saveTemplate): self
{
$this->saveTemplate = $saveTemplate;
return $this;
}
public function getArticle(): ?Articles
{
return $this->article;
}
public function setArticle(?Articles $article): self
{
$this->article = $article;
return $this;
}
public function isHtml(): ?bool
{
return $this->html;
}
public function isVisibilityUser(): ?bool
{
return $this->visibilityUser;
}
public function isOnlyVisitor(): ?bool
{
return $this->onlyVisitor;
}
public function isVisibilityTitle(): ?bool
{
return $this->visibilityTitle;
}
public function isVisibilityDate(): ?bool
{
return $this->visibilityDate;
}
public function isStartPage(): ?bool
{
return $this->startPage;
}
}