<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\PodcastEpisodeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
// PodcastEpisode est pour place à l'expert-comptable => widget pour EC participants à l'épisode et sur le site de lagence.expert
/**
* @Vich\Uploadable
*/
#[ORM\Entity(repositoryClass: PodcastEpisodeRepository::class)]
class PodcastEpisode
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'integer')]
private $number;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $title;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $main_description_txt;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $main_description_rtf;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $sub_description_txt;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $sub_description_rtf;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $notes_txt;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $notes_rtf;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $url_amazon;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $url_deezer;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $url_itunes;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $url_spotify;
#[ORM\Column(type: 'text', length: 16777215, nullable: true)]
private $url_youtube;
#[ORM\Column(type: 'date', nullable: true)]
private $publishedDate;
#[ORM\OneToMany(mappedBy: 'podcastEc', targetEntity: PodcastPrivateTask::class)]
private $podcastPrivateTasks;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $idAushaEpisodeEc;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $filenameEc;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $idAushaEpisodeAgence;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $filenameAgence;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $idAushaPlaylist;
#[ORM\Column(type: 'boolean', nullable: true)]
private $generate;
/**
* @Vich\UploadableField(mapping="podcast_middle_file", fileNameProperty="podcastMiddleFilename")
* @var File|null
*/
private ?File $podcastMiddleFile = null;
#[ORM\Column(nullable: true)]
private ?string $podcastMiddleFilename = null;
#[ORM\ManyToOne(targetEntity: PodcastExpertComptable::class, inversedBy: 'podcastEpisodesEc')]
private $podcastExpertComptable;
// NOTE: This is not a mapped field of entity metadata, just a simple property.
/**
* @Vich\UploadableField(mapping="podcast_ec_image_file", fileNameProperty="imageName")
* @var File|null
*/
private ?File $imageFile = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $imageName = null;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private ?\DateTimeImmutable $updateAt = null;
public function __construct()
{
$this->podcastPrivateTasks = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNumber(): ?int
{
return $this->number;
}
public function setNumber(?int $number): self
{
$this->number = $number;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getMainDescriptionTxt(): ?string
{
return $this->main_description_txt;
}
public function setMainDescriptionTxt(?string $main_description_txt): self
{
$this->main_description_txt = $main_description_txt;
return $this;
}
public function getMainDescriptionRtf(): ?string
{
return $this->main_description_rtf;
}
public function setMainDescriptionRtf(?string $main_description_rtf): self
{
$this->main_description_rtf = $main_description_rtf;
$descriptifTexte = str_replace(' ', ' ', $main_description_rtf);
$descriptifTexte = str_replace('<br />', ' ', $descriptifTexte);
$descriptifTexte = strip_tags($descriptifTexte);
$this->main_description_txt = $descriptifTexte;
return $this;
}
public function getSubDescriptionTxt(): ?string
{
return $this->sub_description_txt;
}
public function setSubDescriptionTxt(?string $sub_description_txt): self
{
$this->sub_description_txt = $sub_description_txt;
return $this;
}
public function getSubDescriptionRtf(): ?string
{
return $this->sub_description_rtf;
}
public function setSubDescriptionRtf(?string $sub_description_rtf): self
{
$this->sub_description_rtf = $sub_description_rtf;
$descriptifTexte = str_replace(' ', ' ', $sub_description_rtf);
$descriptifTexte = str_replace('<br />', ' ', $descriptifTexte);
$descriptifTexte = strip_tags($descriptifTexte);
$this->sub_description_txt = $descriptifTexte;
return $this;
}
public function getNotesTxt(): ?string
{
return $this->notes_txt;
}
public function setNotesTxt(?string $notes_txt): self
{
$this->notes_txt = $notes_txt;
return $this;
}
public function getNotesRtf(): ?string
{
return $this->notes_rtf;
}
public function setNotesRtf(?string $notes_rtf): self
{
$this->notes_rtf = $notes_rtf;
$descriptifTexte = str_replace(' ', ' ', $notes_rtf);
$descriptifTexte = str_replace('<br />', ' ', $descriptifTexte);
$descriptifTexte = strip_tags($descriptifTexte);
$this->notes_txt = $descriptifTexte;
return $this;
}
public function getUrlAmazon(): ?string
{
return $this->url_amazon;
}
public function setUrlAmazon(?string $url_amazon): self
{
$this->url_amazon = $url_amazon;
return $this;
}
public function getUrlDeezer(): ?string
{
return $this->url_deezer;
}
public function setUrlDeezer(?string $url_deezer): self
{
$this->url_deezer = $url_deezer;
return $this;
}
public function getUrlItunes(): ?string
{
return $this->url_itunes;
}
public function setUrlItunes(?string $url_itunes): self
{
$this->url_itunes = $url_itunes;
return $this;
}
public function getUrlSpotify(): ?string
{
return $this->url_spotify;
}
public function setUrlSpotify(?string $url_spotify): self
{
$this->url_spotify = $url_spotify;
return $this;
}
public function getUrlYoutube(): ?string
{
return $this->url_youtube;
}
public function setUrlYoutube(?string $url_youtube): self
{
$this->url_youtube = $url_youtube;
return $this;
}
public function getPublishedDate(): ?\DateTime
{
return $this->publishedDate;
}
public function setPublishedDate(?\DateTime $publishedDate): self
{
$this->publishedDate = $publishedDate;
return $this;
}
/**
* @return Collection<int, PodcastPrivateTask>
*/
public function getPodcastPrivateTasks(): Collection
{
return $this->podcastPrivateTasks;
}
public function addPodcastPrivateTask(PodcastPrivateTask $podcastPrivateTask): self
{
if (!$this->podcastPrivateTasks->contains($podcastPrivateTask)) {
$this->podcastPrivateTasks[] = $podcastPrivateTask;
$podcastPrivateTask->setPodcastEc($this);
}
return $this;
}
public function removePodcastPrivateTask(PodcastPrivateTask $podcastPrivateTask): self
{
if ($this->podcastPrivateTasks->removeElement($podcastPrivateTask)) {
// set the owning side to null (unless already changed)
if ($podcastPrivateTask->getPodcastEc() === $this) {
$podcastPrivateTask->setPodcastEc(null);
}
}
return $this;
}
public function getIdAushaEpisodeEc(): ?string
{
return $this->idAushaEpisodeEc;
}
public function setIdAushaEpisodeEc(?string $idAushaEpisodeEc): self
{
$this->idAushaEpisodeEc = $idAushaEpisodeEc;
return $this;
}
public function getFilenameEc(): ?string
{
return $this->filenameEc;
}
public function setFilenameEc(?string $filenameEc): self
{
$this->filenameEc = $filenameEc;
return $this;
}
public function getIdAushaEpisodeAgence(): ?string
{
return $this->idAushaEpisodeAgence;
}
public function setIdAushaEpisodeAgence(?string $idAushaEpisodeAgence): self
{
$this->idAushaEpisodeAgence = $idAushaEpisodeAgence;
return $this;
}
public function getFilenameAgence(): ?string
{
return $this->filenameAgence;
}
public function setFilenameAgence(?string $filenameAgence): self
{
$this->filenameAgence = $filenameAgence;
return $this;
}
public function getIdAushaPlaylist(): ?string
{
return $this->idAushaPlaylist;
}
public function setIdAushaPlaylist(?string $idAushaPlaylist): self
{
$this->idAushaPlaylist = $idAushaPlaylist;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setPodcastMiddleFile(?File $podcastMiddleFile = null): void
{
$this->podcastMiddleFile = $podcastMiddleFile;
if (null !== $podcastMiddleFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updateAt = new \DateTimeImmutable();
}
}
public function getPodcastMiddleFile(): ?File
{
return $this->podcastMiddleFile;
}
public function setPodcastMiddleFileName(?string $podcastMiddleFilename): void
{
$this->podcastMiddleFilename = $podcastMiddleFilename;
}
public function getPodcastMiddleFileName(): ?string
{
return $this->podcastMiddleFilename;
}
public function getPodcastExpertComptable(): ?PodcastExpertComptable
{
return $this->podcastExpertComptable;
}
public function setPodcastExpertComptable(?PodcastExpertComptable $podcastExpertComptable): self
{
$this->podcastExpertComptable = $podcastExpertComptable;
return $this;
}
public function isGenerate(): ?bool
{
return $this->generate;
}
public function setGenerate(?bool $generate): self
{
$this->generate = $generate;
return $this;
}
public function setImageFile(?File $imageFile = null): void
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updateAt = new \DateTimeImmutable();
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function setImageName(?string $imageName): void
{
$this->imageName = $imageName;
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function getUpdateAt(): ?\DateTimeImmutable
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeImmutable $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
}