src/Entity/Actuality.php line 15
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\ActualityRepository;
use Symfony\Component\HttpFoundation\File\File;
use App\Entity\Trait\CreatedAtTrait;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: ActualityRepository::class)]
#[Vich\Uploadable]
class Actuality
{
use CreatedAtTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Vich\UploadableField(mapping: 'blog_images', fileNameProperty: 'imageName')]
private ?File $imageFile = null;
#[ORM\Column(nullable: true)]
private ?string $imageName = null;
#[ORM\Column(length: 1255)]
private ?string $title = null;
#[ORM\Column(length: 1255)]
private ?string $text = null;
#[ORM\ManyToOne(inversedBy: 'actualities')]
#[ORM\JoinColumn(nullable: false)]
private ?Categories $categories = null;
#[ORM\Column(length: 1255)]
private ?string $subtitle = null;
#[ORM\Column(length: 1255)]
private ?string $content = null;
#[ORM\Column(length: 1255)]
private ?string $intro = null;
public function __construct()
{
$this->created_at = new \DateTimeImmutable();
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function setImageFile(?File $imageFile = null): void
{
$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->updatedAt = new \DateTimeImmutable();
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function setImageName(?string $imageName): void
{
$this->imageName = $imageName;
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(string $text): self
{
$this->text = $text;
return $this;
}
public function getCategories(): ?Categories
{
return $this->categories;
}
public function setCategories(?Categories $categories): self
{
$this->categories = $categories;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(string $subtitle): static
{
$this->subtitle = $subtitle;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): static
{
$this->content = $content;
return $this;
}
public function getIntro(): ?string
{
return $this->intro;
}
public function setIntro(string $intro): static
{
$this->intro = $intro;
return $this;
}
}