<?phpnamespace App\Entity\Pages;use App\Entity\Fiches\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 * * @ORM\Table("pages_pages") * @ORM\Entity(repositoryClass="App\Repository\Pages\PagesRepository") * @ORM\HasLifecycleCallbacks() * @Vich\Uploadable */class Pages{ /** * @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="name", type="string", length=255, nullable=true) */ private $name; /** * @var string * * @ORM\Column(name="folder_slug", type="string", length=255, nullable=true) */ private $folderSlug; /** * @var string * * @ORM\Column(name="folder_slug2", type="string", length=255, nullable=true) */ private $folderSlug2; /** * @var string * * @ORM\Column(name="folder_slug3", type="string", length=255, nullable=true) */ private $folderSlug3; /** * @var string * * @ORM\Column(name="title", type="string", length=255, nullable=true) */ private $title; /** * @var string * * @ORM\Column(name="short_title", type="string", length=255, nullable=true) */ private $shortTitle; /** * @var string * * @ORM\Column(name="description", type="text", nullable=true) */ private $description; /** * @var string * * @ORM\Column(name="short_description", type="text", nullable=true) */ private $shortDescription; /** * @var string * * @ORM\Column(name="views", type="integer", nullable=true) */ private $views; /** * @var string * * @ORM\Column(name="locale", type="string", length=11, nullable=true) */ private $locale; /** * @var string * * @ORM\Column(name="noblock", type="boolean", nullable=true) */ private $noblock; /** * @var string * * @ORM\Column(name="robots", type="string", length=255, nullable=true) */ private $robots; /** * @var string * * @ORM\Column(name="type", type="string", length=255, nullable=true) */ private $type; /** * @var string * * @ORM\Column(name="sitemap", type="boolean", nullable=true) */ private $sitemap; /** * @var string * * @ORM\Column(name="menu_absolute", type="boolean", nullable=true) */ private $menuAbsolute; /** * @var string * * @ORM\Column(name="theme", type="string", length=255, nullable=true) */ private $theme; /** * @var string * * @ORM\Column(name="style", type="text", nullable=true) */ private $style; /** * @var string * * @ORM\Column(name="javascript", type="text", nullable=true) */ private $javascript; /** * @var string * * @ORM\Column(name="redirect", type="text", nullable=true) */ private $redirect; /** * @var string * * @ORM\Column(name="identifiant", type="string", length=255, nullable=true) */ private $identifiant; /** * 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 string * * @ORM\Column(name="sequence", type="integer", length=11, nullable=true) */ private $sequence; /** * @var string * * @ORM\Column(name="canonical", type="text", nullable=true) */ private $canonical; /** * @var string * * @ORM\Column(name="author", type="string", length=155, nullable=true) */ private $author; /** * @var string * * @ORM\Column(name="premium", type="boolean", nullable=true) */ private $premium; /** * @var \App\Entity\Fiches\Articles * * @ORM\ManyToOne(targetEntity="App\Entity\Fiches\Articles") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="fiche_id", referencedColumnName="id", nullable=true) * }) */ protected $fiche; /** * @var string * * @ORM\Column(name="navbar", type="string", length=155, nullable=true) */ private $navbar; /** * @var string * * @ORM\Column(name="navbar_background_color", type="string", length=155, nullable=true) */ private $navbarBG; 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")); $this->setViews(0); $this->setType("brouillon"); $this->setPremium(false); } /** * @ORM\PreUpdate */ public function setUpdatedAtValue(): void { $this->setUpdatedAt(new \DateTime("now")); } public function __toString() { return (string)$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 getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getFolderSlug(): ?string { return $this->folderSlug; } public function setFolderSlug(?string $folderSlug): self { $this->folderSlug = $folderSlug; return $this; } public function getFolderSlug2(): ?string { return $this->folderSlug2; } public function setFolderSlug2(?string $folderSlug2): self { $this->folderSlug2 = $folderSlug2; return $this; } public function getFolderSlug3(): ?string { return $this->folderSlug3; } public function setFolderSlug3(?string $folderSlug3): self { $this->folderSlug3 = $folderSlug3; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): self { $this->title = $title; return $this; } public function getShortTitle(): ?string { return $this->shortTitle; } public function setShortTitle(?string $shortTitle): self { $this->shortTitle = $shortTitle; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getShortDescription(): ?string { return $this->shortDescription; } public function setShortDescription(?string $shortDescription): self { $this->shortDescription = $shortDescription; return $this; } public function getViews(): ?int { return $this->views; } public function setViews(?int $views): self { $this->views = $views; return $this; } public function getLocale(): ?string { return $this->locale; } public function setLocale(?string $locale): self { $this->locale = $locale; return $this; } public function getNoblock(): ?bool { return $this->noblock; } public function setNoblock(?bool $noblock): self { $this->noblock = $noblock; return $this; } public function getRobots(): ?string { return $this->robots; } public function setRobots(?string $robots): self { $this->robots = $robots; return $this; } public function getType(): ?string { return $this->type; } public function setType(?string $type): self { $this->type = $type; return $this; } public function getSitemap(): ?bool { return $this->sitemap; } public function setSitemap(?bool $sitemap): self { $this->sitemap = $sitemap; return $this; } public function getTheme(): ?string { return $this->theme; } public function setTheme(?string $theme): self { $this->theme = $theme; return $this; } public function getStyle(): ?string { return $this->style; } public function setStyle(?string $style): self { $this->style = $style; return $this; } public function getJavascript(): ?string { return $this->javascript; } public function setJavascript(?string $javascript): self { $this->javascript = $javascript; return $this; } public function getRedirect(): ?string { return $this->redirect; } public function setRedirect(?string $redirect): self { $this->redirect = $redirect; return $this; } public function getIdentifiant(): ?string { return $this->identifiant; } public function setIdentifiant(?string $identifiant): self { $this->identifiant = $identifiant; return $this; } public function getSequence(): ?int { return $this->sequence; } public function setSequence(?int $sequence): self { $this->sequence = $sequence; return $this; } public function getCanonical(): ?string { return $this->canonical; } public function setCanonical(?string $canonical): self { $this->canonical = $canonical; return $this; } public function getAuthor(): ?string { return $this->author; } public function setAuthor(?string $author): self { $this->author = $author; return $this; } public function getMenuAbsolute(): ?bool { return $this->menuAbsolute; } public function setMenuAbsolute(?bool $menuAbsolute): self { $this->menuAbsolute = $menuAbsolute; return $this; } public function getPremium(): ?bool { return $this->premium; } public function setPremium(?bool $premium): self { $this->premium = $premium; return $this; } public function getFiche(): ?Articles { return $this->fiche; } public function setFiche(?Articles $fiche): self { $this->fiche = $fiche; return $this; } public function getNavbar(): ?string { return $this->navbar; } public function setNavbar(?string $navbar): self { $this->navbar = $navbar; return $this; } public function getNavbarBG(): ?string { return $this->navbarBG; } public function setNavbarBG(?string $navbar): self { $this->navbarBG = $navbar; return $this; } public function isNoblock(): ?bool { return $this->noblock; } public function isSitemap(): ?bool { return $this->sitemap; } public function isMenuAbsolute(): ?bool { return $this->menuAbsolute; } public function isPremium(): ?bool { return $this->premium; }}