<?php
namespace App\Entity\Fiches;
use App\Entity\Core\Users;
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\Fiches\ArticlesRepository;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Vich\UploaderBundle\Entity\File as EmbeddedFile;
/**
* Articles
*
* @ORM\Table("fiches_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="title", type="string", length=500, nullable=true)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="short_title", type="string", length=255, nullable=true)
*/
private $shortTitle;
/**
* @var string
*
* @ORM\Column(name="short_description", type="text", nullable=true)
*/
private $shortDescription;
/**
* @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="tag", type="string", length=255, nullable=true)
*/
private $tag;
/**
* @var \Categories
*
* @ORM\ManyToOne(targetEntity="App\Entity\Fiches\Categories")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
* })
*/
protected $category;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="description_premium", type="text", nullable=true)
*/
private $descriptionPremium;
/**
* @var \Users
*
* @ORM\ManyToOne(targetEntity="App\Entity\Core\Users")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
* })
*/
protected $user;
/**
* @var string
*
* @ORM\Column(name="status", type="string", length=255, nullable=true)
*/
private $status;
/**
* @var string
*
* @ORM\Column(name="theme", type="string", length=255, nullable=true)
*/
private $theme;
/**
* @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;
}
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): static
{
$this->title = $title;
return $this;
}
public function getShortTitle(): ?string
{
return $this->shortTitle;
}
public function setShortTitle(?string $shortTitle): static
{
$this->shortTitle = $shortTitle;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): static
{
$this->shortDescription = $shortDescription;
return $this;
}
public function getFolderSlug(): ?string
{
return $this->folderSlug;
}
public function setFolderSlug(?string $folderSlug): static
{
$this->folderSlug = $folderSlug;
return $this;
}
public function getFolderSlug2(): ?string
{
return $this->folderSlug2;
}
public function setFolderSlug2(?string $folderSlug2): static
{
$this->folderSlug2 = $folderSlug2;
return $this;
}
public function getFolderSlug3(): ?string
{
return $this->folderSlug3;
}
public function setFolderSlug3(?string $folderSlug3): static
{
$this->folderSlug3 = $folderSlug3;
return $this;
}
public function getTag(): ?string
{
return $this->tag;
}
public function setTag(?string $tag): static
{
$this->tag = $tag;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getDescriptionPremium(): ?string
{
return $this->descriptionPremium;
}
public function setDescriptionPremium(?string $descriptionPremium): static
{
$this->descriptionPremium = $descriptionPremium;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): static
{
$this->status = $status;
return $this;
}
public function getTheme(): ?string
{
return $this->theme;
}
public function setTheme(?string $theme): static
{
$this->theme = $theme;
return $this;
}
public function getCategory(): ?Categories
{
return $this->category;
}
public function setCategory(?Categories $category): static
{
$this->category = $category;
return $this;
}
public function getUser(): ?Users
{
return $this->user;
}
public function setUser(?Users $user): static
{
$this->user = $user;
return $this;
}
}