Add image entity
This commit is contained in:
114
src/Entity/Image.php
Normal file
114
src/Entity/Image.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ImageRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ImageRepository::class)]
|
||||
#[ORM\Table(name: 'immagine')]
|
||||
class Image implements \JsonSerializable
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $filename = null;
|
||||
|
||||
#[ORM\Column(name: 'didascalia', length: 255, nullable: true)]
|
||||
private ?string $caption = null;
|
||||
|
||||
#[ORM\Column(name: 'autore', length: 255, nullable: true)]
|
||||
private ?string $author = null;
|
||||
|
||||
#[ORM\Column(name: 'sito', type: Types::BIGINT, nullable: true)]
|
||||
private ?string $site = null;
|
||||
|
||||
#[ORM\Column(name: 'ordine', type: Types::SMALLINT)]
|
||||
private ?int $sequence = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFilename(): ?string
|
||||
{
|
||||
return $this->filename;
|
||||
}
|
||||
|
||||
public function setFilename(string $filename): static
|
||||
{
|
||||
$this->filename = $filename;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCaption(): ?string
|
||||
{
|
||||
return $this->caption;
|
||||
}
|
||||
|
||||
public function setCaption(?string $caption): static
|
||||
{
|
||||
$this->caption = $caption;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAuthor(): ?string
|
||||
{
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
public function setAuthor(?string $author): static
|
||||
{
|
||||
$this->author = $author;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSite(): ?string
|
||||
{
|
||||
return $this->site;
|
||||
}
|
||||
|
||||
public function setSite(?string $site): static
|
||||
{
|
||||
$this->site = $site;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSequence(): ?int
|
||||
{
|
||||
return $this->sequence;
|
||||
}
|
||||
|
||||
public function setSequence(int $sequence): static
|
||||
{
|
||||
$this->sequence = $sequence;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'filename' => $this->filename,
|
||||
'caption' => $this->caption,
|
||||
'author' => $this->author,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user