<?php
namespace App\Entity;
use App\Repository\BannersRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BannersRepository::class)]
class Banners
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Pages::class, inversedBy: 'banners')]
private $page;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $alt;
#[ORM\Column(type: 'datetime')]
private $modified;
#[ORM\Column(type: 'datetime')]
private $created;
#[ORM\Column(type: 'boolean')]
private $isPublished;
#[ORM\Column(type: 'boolean')]
private $isDefault;
#[ORM\Column(type: 'integer')]
private $orderBy;
#[ORM\Column(type: 'text', nullable: true)]
private $caption;
public function __construct()
{
$this->setModified(new \DateTime());
if ($this->getCreated() == null) {
$this->setCreated(new \DateTime());
}
}
public function getId(): ?int
{
return $this->id;
}
public function getPage(): ?Pages
{
return $this->page;
}
public function setPage(?Pages $page): self
{
$this->page = $page;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getAlt(): ?string
{
return $this->alt;
}
public function setAlt(?string $alt): self
{
$this->alt = $alt;
return $this;
}
public function getModified(): ?\DateTimeInterface
{
return $this->modified;
}
public function setModified(\DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function isIsPublished(): ?bool
{
return $this->isPublished;
}
public function setIsPublished(bool $isPublished): self
{
$this->isPublished = $isPublished;
return $this;
}
public function getIsDefault(): ?bool
{
return $this->isDefault;
}
public function setIsDefault(bool $isDefault): self
{
$this->isDefault = $isDefault;
return $this;
}
public function getOrderBy(): ?int
{
return $this->orderBy;
}
public function setOrderBy(int $orderBy): self
{
$this->orderBy = $orderBy;
return $this;
}
public function getCaption(): ?string
{
return $this->caption;
}
public function setCaption(?string $caption): self
{
$this->caption = $caption;
return $this;
}
}