src/AppBundle/Entity/Logo.php line 17
<?php
namespace AppBundle\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Table(name="logo")
* @ORM\Entity(repositoryClass="AppBundle\Repository\LogoRepository")
* @ORM\HasLifecycleCallbacks()
* @Vich\Uploadable
*/
class Logo
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
/**
* @var string
*
* @ORM\Column(name="desktop", type="string", length=255, nullable=true)
* @Assert\NotBlank()
*/
private ?string $desktop = null;
/**
* @var File
*
* @Vich\UploadableField(mapping="logos_desktop", fileNameProperty="desktop")
*/
private ?File $imagenDesktop;
/**
* @var string
*
* @ORM\Column(name="mobile", type="string", length=255, nullable=true)
* @Assert\NotBlank()
*/
private ?string $mobile = null;
/**
* @var File
*
* @Vich\UploadableField(mapping="logos_mobile", fileNameProperty="mobile")
*/
private ?File $imagenMobile;
/**
* @var DateTime
*
* @ORM\Column(name="vigencia_desde", type="datetime")
* @Assert\NotBlank()
*/
private ?DateTime $vigenciaDesde = null;
/**
* @var DateTime
*
* @ORM\Column(name="vigencia_hasta", type="datetime")
* @Assert\NotBlank()
*/
private ?DateTime $vigenciaHasta = null;
/**
* @var bool
*
* @ORM\Column(name="habilitado", type="boolean")
* @Assert\NotBlank()
*/
private ?bool $habilitado = null;
/**
* @var DateTime
*
* @ORM\Column(name="created_at", type="datetime", options={"default": "CURRENT_TIMESTAMP"})
* @Assert\NotBlank()
*/
private ?DateTime $createdAt = null;
/**
* @var DateTime
*
* @ORM\Column(name="updated_at", type="datetime")
* @Assert\NotBlank()
*/
private ?DateTime $updatedAt = null;
public function getId(): ?int
{
return $this->id;
}
public function getDesktop(): ?string
{
return $this->desktop;
}
public function setDesktop(?string $desktop): self
{
$this->desktop = $desktop;
return $this;
}
public function setImagenDesktop(File $imagenDesktop = null): self
{
$this->imagenDesktop = $imagenDesktop;
if ($imagenDesktop) {
$this->updatedAt = new \DateTime('now');
}
return $this;
}
public function getImagenDesktop(): ?File
{
return $this->imagenDesktop;
}
public function getMobile(): ?string
{
return $this->mobile;
}
public function setMobile(?string $mobile): self
{
$this->mobile = $mobile;
return $this;
}
public function setImagenMobile(File $imagenMobile = null): self
{
$this->imagenMobile = $imagenMobile;
if ($imagenMobile) {
$this->updatedAt = new \DateTime('now');
}
return $this;
}
public function getImagenMobile(): ?File
{
return $this->imagenMobile;
}
public function getVigenciaDesde(): ?DateTime
{
return $this->vigenciaDesde;
}
public function setVigenciaDesde(?DateTime $vigenciaDesde): self
{
$this->vigenciaDesde = $vigenciaDesde;
return $this;
}
public function getVigenciaHasta(): ?DateTime
{
return $this->vigenciaHasta;
}
public function setVigenciaHasta(?DateTime $vigenciaHasta): self
{
$this->vigenciaHasta = $vigenciaHasta;
return $this;
}
public function getHabilitado(): ?bool
{
return $this->habilitado;
}
public function setHabilitado(?bool $habilitado): self
{
$this->habilitado = $habilitado;
return $this;
}
public function getCreatedAt(): ?DateTime
{
return $this->createdAt;
}
public function setCreatedAt(?DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?DateTime
{
return $this->updatedAt;
}
public function setUpdatedAt(?DateTime $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
}