<?php
namespace App\Entity\Articles;
use App\Entity\Jobs\Database;
use Doctrine\DBAL\Types\Types;
use Symfony\Component\Serializer\Annotation\Groups;
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 App\Repository\Articles\ArticlesRepository;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Vich\UploaderBundle\Entity\File as EmbeddedFile;
/**
* Articles
*
* @ORM\Table("articles_articles")
* @ORM\Entity(repositoryClass=ArticlesRepository::class)
* @ORM\HasLifecycleCallbacks()
* @Vich\Uploadable
*/
class Articles {
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* [Groups(['list', 'item'])]
*/
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="published_at", type="datetime", nullable=true)
* [Groups(['list', 'item'])]
*/
private $publishedAt;
/**
* @var string
*
* @ORM\Column(name="slug", type="string", length=255, nullable=true)
*/
private $slug;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=500, nullable=true)
* [Groups(['list', 'item'])]
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="title_link", type="string", length=500, nullable=true)
* [Groups(['list', 'item'])]
*/
private $titleLink;
/**
* @var string
*
* @ORM\Column(name="shortTitle", type="string", length=500, nullable=true)
*/
private $shortTitle;
/**
* @var string
*
* @ORM\Column(name="subtitle", type="text", nullable=true)
*/
private $subtitle;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=500, nullable=true)
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="short_description", type="text", nullable=true)
*/
private $shortDescription;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
* [Groups(['list', 'item'])]
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="description_start", type="text", nullable=true)
* [Groups(['list', 'item'])]
*/
private $descriptionStart;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Vich\UploadableField(mapping="articles_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions")
* @Assert\File(
* maxSize = "8M",
* mimeTypes={"image/jpeg", "image/png", "image/webp"},
* mimeTypesMessage = "Please upload a valid PDF or image"
* )
* @var File|null
*/
private $imageFile;
/**
* @ORM\Embedded(class="Vich\UploaderBundle\Entity\File")
*
* @var EmbeddedFile
*/
private $image;
/**
* @var string
*
* @ORM\Column(name="image_alt", type="string", length=500, nullable=true)
*/
private $imageAlt;
/**
* @var string
*
* @ORM\Column(name="image_title", type="string", length=500, nullable=true)
*/
private $imageTitle;
/**
* @var string
*
* @ORM\Column(name="visibility", type="boolean", nullable=true)
*/
private $visibility;
/**
* @var string
*
* @ORM\Column(name="autopublished_at", type="datetime", nullable=true)
*/
private $autopublishedAt;
/**
* @var string
*
* @ORM\Column(name="sitemap", type="boolean", nullable=true)
*/
private $sitemap;
/**
* @var string
*
* @ORM\Column(name="robots", type="string", length=255, nullable=true)
*/
private $robots;
/**
* @var string
*
* @ORM\Column(name="canonical", type="string", length=500, nullable=true)
*/
private $canonical;
/**
* @var string
*
* @ORM\Column(name="author", type="string", length=155, nullable=true)
*/
private $author;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=500, nullable=true)
*/
private $url;
/**
* @var string
*
* @ORM\Column(name="recruiter", type="boolean", nullable=true)
*/
private $recruiter;
/**
* @var string
*
* @ORM\Column(name="company", type="boolean", nullable=true)
*/
private $company;
/**
* @var string
*
* @ORM\Column(name="website", type="boolean", nullable=true)
*/
private $website;
/**
* @var string
*
* @ORM\Column(name="locale", type="string", length=11, nullable=true)
*/
private $locale;
/**
* @var string
*
* @ORM\Column(name="banner_title", type="text", nullable=true)
* [Groups(['list', 'item'])]
*/
private $bannerTitle;
/**
* @var string
*
* @ORM\Column(name="banner_description", type="text", nullable=true)
* [Groups(['list', 'item'])]
*/
private $bannerDescription;
/**
* @var string
*
* @ORM\Column(name="banner_link", type="text", nullable=true)
* [Groups(['list', 'item'])]
*/
private $bannerLink;
/**
* @var string
*
* @ORM\Column(name="banner_button", type="text", nullable=true)
* [Groups(['list', 'item'])]
*/
private $bannerButton;
/**
* @var string
*
* @ORM\Column(name="pageslug", type="string", length=255, nullable=true)
*/
private $pageSlug;
/**
* @var string
*
* @ORM\Column(name="pageslug2", type="string", length=255, nullable=true)
*/
private $pageSlug2;
/**
* @var string
*
* @ORM\Column(name="pageslug3", type="string", length=255, nullable=true)
*/
private $pageSlug3;
/**
* @var string
*
* @ORM\Column(name="onlyPage", type="boolean", nullable=true)
*/
private $onlyPage;
/**
* @var string
*
* @ORM\Column(name="onlyArticles", type="boolean", nullable=true)
*/
private $onlyArticles;
/**
* @var string
*
* @ORM\Column(name="recruiterDirectory", type="boolean", nullable=true)
*/
private $recruiterDirectory;
/**
* @var string
*
* @ORM\Column(name="employerDirectory", type="boolean", nullable=true)
*/
private $employerDirectory;
/**
* @var string
*
* @ORM\Column(name="title_ariane", type="string", length=500, nullable=true)
*/
private $titleAriane;
/**
* @var string
*
* @ORM\Column(name="identifiant", type="string", length=500, nullable=true)
*/
private $identifiant;
/**
* @var string
*
* @ORM\Column(name="keyword", type="string", length=500, nullable=true)
*/
private $keyword;
/**
* @var string
*
* @ORM\Column(name="months_update", type="string", length=500, nullable=true)
*/
private $monthsUpdate;
/**
* @var string
*
* @ORM\Column(name="volume", type="string", length=500, nullable=true)
*/
private $volume;
/**
* @var string
*
* @ORM\Column(name="links_info", type="boolean", nullable=true)
*/
private $links;
/**
* @var string
*
* @ORM\Column(name="schema_info", type="boolean", nullable=true)
*/
private $schema;
/**
* @var string
*
* @ORM\Column(name="video_info", type="boolean", nullable=true)
*/
private $video;
/**
* @var \ArticlesHasCategories
*
* @ORM\ManyToOne(targetEntity="ArticlesHasCategories")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
* })
*/
protected $category;
/**
* @var \ArticlesAuthors
*
* @ORM\ManyToOne(targetEntity="ArticlesAuthors")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="author_article_id", referencedColumnName="id", nullable=true)
* })
*/
protected $authorArticle;
/**
* @var string
*
* @ORM\Column(name="message_alert", type="text", nullable=true)
*/
private $messageAlert;
/**
* @var string
*
* @ORM\Column(name="editor_html", type="boolean", nullable=true)
*/
private $editorHTML;
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->visibility = false;
}
/**
* @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 getPublishedAt(): ?\DateTimeInterface
{
return $this->publishedAt;
}
public function setPublishedAt(?\DateTimeInterface $publishedAt): self
{
$this->publishedAt = $publishedAt;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getTitleLink(): ?string
{
return $this->titleLink;
}
public function setTitleLink(?string $title): self
{
$this->titleLink = $title;
return $this;
}
public function getShortTitle(): ?string
{
return $this->shortTitle;
}
public function setShortTitle(?string $shortTitle): self
{
$this->shortTitle = $shortTitle;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDescriptionStart(): ?string
{
return $this->descriptionStart;
}
public function setDescriptionStart(?string $descriptionStart): self
{
$this->descriptionStart = $descriptionStart;
return $this;
}
public function getVisibility(): ?bool
{
return $this->visibility;
}
public function setVisibility(?bool $visibility): self
{
$this->visibility = $visibility;
return $this;
}
public function getAutopublishedAt(): ?\DateTimeInterface
{
return $this->autopublishedAt;
}
public function setAutopublishedAt(?\DateTimeInterface $autopublishedAt): self
{
$this->autopublishedAt = $autopublishedAt;
return $this;
}
public function getSitemap(): ?bool
{
return $this->sitemap;
}
public function setSitemap(?bool $sitemap): self
{
$this->sitemap = $sitemap;
return $this;
}
public function getRobots(): ?string
{
return $this->robots;
}
public function setRobots(?string $robots): self
{
$this->robots = $robots;
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 getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getRecruiter(): ?bool
{
return $this->recruiter;
}
public function setRecruiter(?bool $recruiter): self
{
$this->recruiter = $recruiter;
return $this;
}
public function getCompany(): ?bool
{
return $this->company;
}
public function setCompany(?bool $company): self
{
$this->company = $company;
return $this;
}
public function getWebsite(): ?bool
{
return $this->website;
}
public function setWebsite(?bool $website): self
{
$this->website = $website;
return $this;
}
public function getLocale(): ?string
{
return $this->locale;
}
public function setLocale(?string $locale): self
{
$this->locale = $locale;
return $this;
}
public function isVisibility(): ?bool
{
return $this->visibility;
}
public function isSitemap(): ?bool
{
return $this->sitemap;
}
public function isRecruiter(): ?bool
{
return $this->recruiter;
}
public function isCompany(): ?bool
{
return $this->company;
}
public function isWebsite(): ?bool
{
return $this->website;
}
public function getBannerDescription(): ?string
{
return $this->bannerDescription;
}
public function setBannerDescription(?string $description): self
{
$this->bannerDescription = $description;
return $this;
}
public function getBannerLink(): ?string
{
return $this->bannerLink;
}
public function setBannerLink(?string $description): self
{
$this->bannerLink = $description;
return $this;
}
public function getBannerTitle(): ?string
{
return $this->bannerTitle;
}
public function setBannerTitle(?string $description): self
{
$this->bannerTitle = $description;
return $this;
}
public function getBannerButton(): ?string
{
return $this->bannerButton;
}
public function setBannerButton(?string $description): self
{
$this->bannerButton = $description;
return $this;
}
public function getImageTitle(): ?string
{
return $this->imageTitle;
}
public function setImageTitle(?string $imageTitle): self
{
$this->imageTitle = $imageTitle;
return $this;
}
public function getImageAlt(): ?string
{
return $this->imageAlt;
}
public function setImageAlt(?string $imageAlt): self
{
$this->imageAlt = $imageAlt;
return $this;
}
public function getPageSlug(): ?string
{
return $this->pageSlug;
}
public function setPageSlug(?string $pageSlug): static
{
$this->pageSlug = $pageSlug;
return $this;
}
public function getPageSlug2(): ?string
{
return $this->pageSlug2;
}
public function setPageSlug2(?string $pageSlug2): static
{
$this->pageSlug2 = $pageSlug2;
return $this;
}
public function getPageSlug3(): ?string
{
return $this->pageSlug3;
}
public function setPageSlug3(?string $pageSlug3): static
{
$this->pageSlug3 = $pageSlug3;
return $this;
}
public function isOnlyPage(): ?bool
{
return $this->onlyPage;
}
public function setOnlyPage(?bool $onlyPage): static
{
$this->onlyPage = $onlyPage;
return $this;
}
public function isOnlyArticles(): ?bool
{
return $this->onlyArticles;
}
public function setOnlyArticles(?bool $onlyArticles): static
{
$this->onlyArticles = $onlyArticles;
return $this;
}
public function getTitleAriane(): ?string
{
return $this->titleAriane;
}
public function setTitleAriane(?string $titleAriane): static
{
$this->titleAriane = $titleAriane;
return $this;
}
public function getCategory(): ?ArticlesHasCategories
{
return $this->category;
}
public function setCategory(?ArticlesHasCategories $category): static
{
$this->category = $category;
return $this;
}
public function getIdentifiant(): ?string
{
return $this->identifiant;
}
public function setIdentifiant(?string $identifiant): static
{
$this->identifiant = $identifiant;
return $this;
}
public function getKeyword(): ?string
{
return $this->keyword;
}
public function setKeyword(?string $keyword): static
{
$this->keyword = $keyword;
return $this;
}
public function getMonthsUpdate(): ?string
{
return $this->monthsUpdate;
}
public function setMonthsUpdate(?string $monthsUpdate): static
{
$this->monthsUpdate = $monthsUpdate;
return $this;
}
public function isLinks(): ?bool
{
return $this->links;
}
public function setLinks(?bool $links): static
{
$this->links = $links;
return $this;
}
public function isSchema(): ?bool
{
return $this->schema;
}
public function setSchema(?bool $schema): static
{
$this->schema = $schema;
return $this;
}
public function isVideo(): ?bool
{
return $this->video;
}
public function setVideo(?bool $video): static
{
$this->video = $video;
return $this;
}
public function getVolume(): ?string
{
return $this->volume;
}
public function setVolume(?string $keyword): static
{
$this->volume = $keyword;
return $this;
}
public function isRecruiterDirectory(): ?bool
{
return $this->recruiterDirectory;
}
public function setRecruiterDirectory(?bool $recruiterDirectory): static
{
$this->recruiterDirectory = $recruiterDirectory;
return $this;
}
public function isEmployerDirectory(): ?bool
{
return $this->employerDirectory;
}
public function setEmployerDirectory(?bool $employerDirectory): static
{
$this->employerDirectory = $employerDirectory;
return $this;
}
public function getAuthorArticle(): ?ArticlesAuthors
{
return $this->authorArticle;
}
public function setAuthorArticle(?ArticlesAuthors $authorArticle): static
{
$this->authorArticle = $authorArticle;
return $this;
}
public function getMessageAlert(): ?string
{
return $this->messageAlert;
}
public function setMessageAlert(?string $messageAlert): static
{
$this->messageAlert = $messageAlert;
return $this;
}
public function isEditorHTML(): ?bool
{
return $this->editorHTML;
}
public function setEditorHTML(?bool $editorHTML): static
{
$this->editorHTML = $editorHTML;
return $this;
}
}