<?php
namespace App\Entity;
use App\Repository\ProgramaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=ProgramaRepository::class)
* @Vich\Uploadable()
*/
class Programa
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @Vich\UploadableField(mapping="programas", fileNameProperty="imageName", size="imageSize")
*/
private $imageFile = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imageName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $imageSize;
/**
* @ORM\Column(type="string", length=255)
*/
private $content;
/**
* @ORM\Column(type="string", length=1000, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActivo;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isPublico;
/**
* @ORM\ManyToOne(targetEntity=ProgramaType::class, inversedBy="programas")
*/
private $programaType;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\ManyToMany(targetEntity=Provider::class, inversedBy="programas")
*/
private $provider;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $abrev;
public function __construct()
{
// $this->providers = new ArrayCollection();
$this->provider = new ArrayCollection();
}
public function setImageFile(?File $imageFile = null): void
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function getId(): ?int
{
return $this->id;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getIsActivo(): ?bool
{
return $this->isActivo;
}
public function setIsActivo(?bool $isActivo): self
{
$this->isActivo = $isActivo;
return $this;
}
public function getIsPublico(): ?bool
{
return $this->isPublico;
}
public function setIsPublico(?bool $isPublico): self
{
$this->isPublico = $isPublico;
return $this;
}
public function getProgramaType(): ?ProgramaType
{
return $this->programaType;
}
public function setProgramaType(?ProgramaType $programaType): self
{
$this->programaType = $programaType;
return $this;
}
public function __toString()
{
return $this->content;
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function setImageName(?string $imageName): self
{
$this->imageName = $imageName;
return $this;
}
public function getImageSize(): ?int
{
return $this->imageSize;
}
public function setImageSize(?int $imageSize): self
{
$this->imageSize = $imageSize;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, Provider>
*/
public function getProvider(): Collection
{
return $this->provider;
}
public function addProvider(Provider $provider): self
{
if (!$this->provider->contains($provider)) {
$this->provider[] = $provider;
}
return $this;
}
public function removeProvider(Provider $provider): self
{
$this->provider->removeElement($provider);
return $this;
}
public function getAbrev(): ?string
{
return $this->abrev;
}
public function setAbrev(?string $abrev): self
{
$this->abrev = $abrev;
return $this;
}
}