src/Entity/Programa.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProgramaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10. * @ORM\Entity(repositoryClass=ProgramaRepository::class)
  11. * @Vich\Uploadable()
  12. */
  13. class Programa
  14. {
  15. /**
  16. * @ORM\Id
  17. * @ORM\GeneratedValue
  18. * @ORM\Column(type="integer")
  19. */
  20. private $id;
  21. /**
  22. * @Vich\UploadableField(mapping="programas", fileNameProperty="imageName", size="imageSize")
  23. */
  24. private $imageFile = null;
  25. /**
  26. * @ORM\Column(type="string", length=255, nullable=true)
  27. */
  28. private $imageName;
  29. /**
  30. * @ORM\Column(type="integer", nullable=true)
  31. */
  32. private $imageSize;
  33. /**
  34. * @ORM\Column(type="string", length=255)
  35. */
  36. private $content;
  37. /**
  38. * @ORM\Column(type="string", length=1000, nullable=true)
  39. */
  40. private $description;
  41. /**
  42. * @ORM\Column(type="boolean", nullable=true)
  43. */
  44. private $isActivo;
  45. /**
  46. * @ORM\Column(type="boolean", nullable=true)
  47. */
  48. private $isPublico;
  49. /**
  50. * @ORM\ManyToOne(targetEntity=ProgramaType::class, inversedBy="programas")
  51. */
  52. private $programaType;
  53. /**
  54. * @ORM\Column(type="datetime_immutable", nullable=true)
  55. */
  56. private $updatedAt;
  57. /**
  58. * @ORM\Column(type="string", length=255, nullable=true)
  59. */
  60. private $slug;
  61. /**
  62. * @ORM\ManyToMany(targetEntity=Provider::class, inversedBy="programas")
  63. */
  64. private $provider;
  65. /**
  66. * @ORM\Column(type="string", length=255, nullable=true)
  67. */
  68. private $abrev;
  69. public function __construct()
  70. {
  71. // $this->providers = new ArrayCollection();
  72. $this->provider = new ArrayCollection();
  73. }
  74. public function setImageFile(?File $imageFile = null): void
  75. {
  76. $this->imageFile = $imageFile;
  77. if (null !== $imageFile) {
  78. $this->updatedAt = new \DateTimeImmutable();
  79. }
  80. }
  81. public function getImageFile(): ?File
  82. {
  83. return $this->imageFile;
  84. }
  85. public function getId(): ?int
  86. {
  87. return $this->id;
  88. }
  89. public function getContent(): ?string
  90. {
  91. return $this->content;
  92. }
  93. public function setContent(string $content): self
  94. {
  95. $this->content = $content;
  96. return $this;
  97. }
  98. public function getDescription(): ?string
  99. {
  100. return $this->description;
  101. }
  102. public function setDescription(?string $description): self
  103. {
  104. $this->description = $description;
  105. return $this;
  106. }
  107. public function getIsActivo(): ?bool
  108. {
  109. return $this->isActivo;
  110. }
  111. public function setIsActivo(?bool $isActivo): self
  112. {
  113. $this->isActivo = $isActivo;
  114. return $this;
  115. }
  116. public function getIsPublico(): ?bool
  117. {
  118. return $this->isPublico;
  119. }
  120. public function setIsPublico(?bool $isPublico): self
  121. {
  122. $this->isPublico = $isPublico;
  123. return $this;
  124. }
  125. public function getProgramaType(): ?ProgramaType
  126. {
  127. return $this->programaType;
  128. }
  129. public function setProgramaType(?ProgramaType $programaType): self
  130. {
  131. $this->programaType = $programaType;
  132. return $this;
  133. }
  134. public function __toString()
  135. {
  136. return $this->content;
  137. }
  138. public function getImageName(): ?string
  139. {
  140. return $this->imageName;
  141. }
  142. public function setImageName(?string $imageName): self
  143. {
  144. $this->imageName = $imageName;
  145. return $this;
  146. }
  147. public function getImageSize(): ?int
  148. {
  149. return $this->imageSize;
  150. }
  151. public function setImageSize(?int $imageSize): self
  152. {
  153. $this->imageSize = $imageSize;
  154. return $this;
  155. }
  156. public function getUpdatedAt(): ?\DateTimeImmutable
  157. {
  158. return $this->updatedAt;
  159. }
  160. public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  161. {
  162. $this->updatedAt = $updatedAt;
  163. return $this;
  164. }
  165. public function getSlug(): ?string
  166. {
  167. return $this->slug;
  168. }
  169. public function setSlug(?string $slug): self
  170. {
  171. $this->slug = $slug;
  172. return $this;
  173. }
  174. /**
  175. * @return Collection<int, Provider>
  176. */
  177. public function getProvider(): Collection
  178. {
  179. return $this->provider;
  180. }
  181. public function addProvider(Provider $provider): self
  182. {
  183. if (!$this->provider->contains($provider)) {
  184. $this->provider[] = $provider;
  185. }
  186. return $this;
  187. }
  188. public function removeProvider(Provider $provider): self
  189. {
  190. $this->provider->removeElement($provider);
  191. return $this;
  192. }
  193. public function getAbrev(): ?string
  194. {
  195. return $this->abrev;
  196. }
  197. public function setAbrev(?string $abrev): self
  198. {
  199. $this->abrev = $abrev;
  200. return $this;
  201. }
  202. }