Files
crowd-fund-api/src/Entity/Project/Update.php
T

133 lines
2.7 KiB
PHP

<?php
namespace App\Entity\Project;
use App\Entity\Trait\LocalizedEntityTrait;
use App\Entity\Trait\TimestampedCreationEntity;
use App\Entity\Trait\TimestampedUpdationEntity;
use App\Mapping\Provider\EntityMapProvider;
use App\Repository\Project\UpdateRepository;
use AutoMapper\Attribute\MapProvider;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[MapProvider(EntityMapProvider::class)]
#[ORM\Table(name: 'project_update')]
#[ORM\Entity(repositoryClass: UpdateRepository::class)]
class Update
{
use LocalizedEntityTrait;
use TimestampedCreationEntity;
use TimestampedUpdationEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'updates')]
#[ORM\JoinColumn(nullable: false)]
private ?Project $project = null;
#[ORM\Column(length: 255)]
#[Gedmo\Translatable()]
private ?string $title = null;
#[ORM\Column(length: 255)]
#[Gedmo\Translatable()]
private ?string $subtitle = null;
#[ORM\Column(type: Types::TEXT)]
#[Gedmo\Translatable()]
private ?string $body = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $cover = null;
public function __construct()
{
$this->date = $this->date ?? new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): static
{
$this->project = $project;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): static
{
$this->title = $title;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(string $subtitle): static
{
$this->subtitle = $subtitle;
return $this;
}
public function getBody(): ?string
{
return $this->body;
}
public function setBody(string $body): static
{
$this->body = $body;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): static
{
$this->date = $date;
return $this;
}
public function getCover(): ?string
{
return $this->cover;
}
public function setCover(?string $cover): static
{
$this->cover = $cover;
return $this;
}
}