src/Entity/Pages/PagesHasBlocks.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Pages;
  3. use App\Entity\Articles\Articles;
  4. use Doctrine\DBAL\Types\Types;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Symfony\Component\HttpFoundation\File\UploadedFile;
  11. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  12. /**
  13. * Pages has blocks
  14. *
  15. * @ORM\Table("pages_pages_has_blocks")
  16. * @ORM\Entity(repositoryClass="App\Repository\Pages\PagesBlocksRepository")
  17. * @ORM\HasLifecycleCallbacks()
  18. * @Vich\Uploadable
  19. */
  20. class PagesHasBlocks
  21. {
  22. /**
  23. * @var integer
  24. *
  25. * @ORM\Column(name="id", type="integer")
  26. * @ORM\Id
  27. * @ORM\GeneratedValue(strategy="AUTO")
  28. */
  29. protected $id;
  30. /**
  31. * @var string
  32. *
  33. * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  34. */
  35. private $createdAt;
  36. /**
  37. * @var string
  38. *
  39. * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  40. */
  41. private $updatedAt;
  42. /**
  43. * @var string
  44. *
  45. * @ORM\Column(name="title", type="text", nullable=true)
  46. */
  47. private $title;
  48. /**
  49. * @var string
  50. *
  51. * @ORM\Column(name="title_block", type="text", nullable=true)
  52. */
  53. private $titleBlock;
  54. /**
  55. * @var string
  56. *
  57. * @ORM\Column(name="description", type="text", nullable=true)
  58. */
  59. private $description;
  60. /**
  61. * @var string
  62. *
  63. * @ORM\Column(name="description_html", type="text", nullable=true)
  64. */
  65. private $descriptionHTML;
  66. /**
  67. * @var string
  68. *
  69. * @ORM\Column(name="svg_html", type="text", nullable=true)
  70. */
  71. private $svgHTML;
  72. /**
  73. * @var string
  74. *
  75. * @ORM\Column(name="backgroundColor", type="text", nullable=true)
  76. */
  77. private $backgroundColor;
  78. /**
  79. * @var string
  80. *
  81. * @ORM\Column(name="html", type="boolean", nullable=true)
  82. */
  83. private $html;
  84. /**
  85. * @var string
  86. *
  87. * @ORM\Column(name="type", type="string", length=255, nullable=true)
  88. */
  89. private $type;
  90. /**
  91. * @var string
  92. *
  93. * @ORM\Column(name="type_block", type="string", length=255, nullable=true)
  94. */
  95. private $typeBlock;
  96. /**
  97. * @var string $sequence
  98. *
  99. * @ORM\Column(name="sequence", type="integer", length=11, nullable=true)
  100. */
  101. protected $sequence;
  102. /**
  103. * @var \Pages
  104. *
  105. * @ORM\ManyToOne(targetEntity="Pages")
  106. * @ORM\JoinColumns({
  107. * @ORM\JoinColumn(name="page_id", referencedColumnName="id", nullable=true)
  108. * })
  109. */
  110. protected $page;
  111. /**
  112. * @var \SaveTemplates
  113. *
  114. * @ORM\ManyToOne(targetEntity="SaveTemplates")
  115. * @ORM\JoinColumns({
  116. * @ORM\JoinColumn(name="savetemplate_id", referencedColumnName="id", nullable=true)
  117. * })
  118. */
  119. protected $saveTemplate;
  120. /**
  121. * @var string
  122. *
  123. * @ORM\Column(name="style", type="text", nullable=true)
  124. */
  125. private $style;
  126. /**
  127. * @var string
  128. *
  129. * @ORM\Column(name="visibility_user", type="boolean", nullable=true)
  130. */
  131. private $visibilityUser;
  132. /**
  133. * @var string
  134. *
  135. * @ORM\Column(name="only_visitor", type="boolean", nullable=true)
  136. */
  137. private $onlyVisitor;
  138. /**
  139. * @var string
  140. *
  141. * @ORM\Column(name="visibility_title", type="boolean", nullable=true)
  142. */
  143. private $visibilityTitle;
  144. /**
  145. * @var string
  146. *
  147. * @ORM\Column(name="visibility_date", type="boolean", nullable=true)
  148. */
  149. private $visibilityDate;
  150. /**
  151. * @var string
  152. *
  153. * @ORM\Column(name="start_page", type="boolean", nullable=true)
  154. */
  155. private $startPage;
  156. /**
  157. * NOTE: This is not a mapped field of entity metadata, just a simple property.
  158. *
  159. * @Vich\UploadableField(mapping="pages_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions")
  160. *
  161. * @var File|null
  162. */
  163. private $imageFile;
  164. /**
  165. * @ORM\Embedded(class="Vich\UploaderBundle\Entity\File")
  166. *
  167. * @var EmbeddedFile
  168. */
  169. private $image;
  170. public function __construct()
  171. {
  172. $this->image = new \Vich\UploaderBundle\Entity\File();
  173. }
  174. /**
  175. * @ORM\PrePersist
  176. */
  177. public function setCreatedAtValue(): void
  178. {
  179. $this->setCreatedAt(new \DateTime("now"));
  180. $this->setUpdatedAt(new \DateTime("now"));
  181. }
  182. /**
  183. * @ORM\PreUpdate
  184. */
  185. public function setUpdatedAtValue(): void
  186. {
  187. $this->setUpdatedAt(new \DateTime("now"));
  188. }
  189. public function __toString()
  190. {
  191. return $this->title;
  192. }
  193. /**
  194. * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  195. * of 'UploadedFile' is injected into this setter to trigger the update. If this
  196. * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  197. * must be able to accept an instance of 'File' as the bundle will inject one here
  198. * during Doctrine hydration.
  199. *
  200. * @param File|UploadedFile|null $imageFile
  201. */
  202. public function setImageFile(?File $imageFile = null)
  203. {
  204. $this->imageFile = $imageFile;
  205. if (null !== $imageFile) {
  206. // It is required that at least one field changes if you are using doctrine
  207. // otherwise the event listeners won't be called and the file is lost
  208. $this->setUpdatedAt(new \DateTime("now"));
  209. }
  210. }
  211. public function getImageFile(): ?File
  212. {
  213. return $this->imageFile;
  214. }
  215. public function setImage(EmbeddedFile $image): void
  216. {
  217. $this->image = $image;
  218. }
  219. public function getImage(): ?EmbeddedFile
  220. {
  221. return $this->image;
  222. }
  223. public function getId(): ?int
  224. {
  225. return $this->id;
  226. }
  227. public function getCreatedAt(): ?\DateTimeInterface
  228. {
  229. return $this->createdAt;
  230. }
  231. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  232. {
  233. $this->createdAt = $createdAt;
  234. return $this;
  235. }
  236. public function getUpdatedAt(): ?\DateTimeInterface
  237. {
  238. return $this->updatedAt;
  239. }
  240. public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  241. {
  242. $this->updatedAt = $updatedAt;
  243. return $this;
  244. }
  245. public function getTitle(): ?string
  246. {
  247. return $this->title;
  248. }
  249. public function setTitle(?string $title): self
  250. {
  251. $this->title = $title;
  252. return $this;
  253. }
  254. public function getTitleBlock(): ?string
  255. {
  256. return $this->titleBlock;
  257. }
  258. public function setTitleBlock(?string $titleBlock): self
  259. {
  260. $this->titleBlock = $titleBlock;
  261. return $this;
  262. }
  263. public function getDescription(): ?string
  264. {
  265. return $this->description;
  266. }
  267. public function setDescription(?string $description): self
  268. {
  269. $this->description = $description;
  270. return $this;
  271. }
  272. public function getDescriptionHTML(): ?string
  273. {
  274. return $this->descriptionHTML;
  275. }
  276. public function setDescriptionHTML(?string $descriptionHTML): self
  277. {
  278. $this->descriptionHTML = $descriptionHTML;
  279. return $this;
  280. }
  281. public function getSvgHTML(): ?string
  282. {
  283. return $this->svgHTML;
  284. }
  285. public function setSvgHTML(?string $svgHTML): self
  286. {
  287. $this->svgHTML = $svgHTML;
  288. return $this;
  289. }
  290. public function getBackgroundColor(): ?string
  291. {
  292. return $this->backgroundColor;
  293. }
  294. public function setBackgroundColor(?string $backgroundColor): self
  295. {
  296. $this->backgroundColor = $backgroundColor;
  297. return $this;
  298. }
  299. public function getHtml(): ?bool
  300. {
  301. return $this->html;
  302. }
  303. public function setHtml(?bool $html): self
  304. {
  305. $this->html = $html;
  306. return $this;
  307. }
  308. public function getType(): ?string
  309. {
  310. return $this->type;
  311. }
  312. public function setType(?string $type): self
  313. {
  314. $this->type = $type;
  315. return $this;
  316. }
  317. public function getTypeBlock(): ?string
  318. {
  319. return $this->typeBlock;
  320. }
  321. public function setTypeBlock(?string $typeBlock): self
  322. {
  323. $this->typeBlock = $typeBlock;
  324. return $this;
  325. }
  326. public function getSequence(): ?int
  327. {
  328. return $this->sequence;
  329. }
  330. public function setSequence(?int $sequence): self
  331. {
  332. $this->sequence = $sequence;
  333. return $this;
  334. }
  335. public function getStyle(): ?string
  336. {
  337. return $this->style;
  338. }
  339. public function setStyle(?string $style): self
  340. {
  341. $this->style = $style;
  342. return $this;
  343. }
  344. public function getVisibilityUser(): ?bool
  345. {
  346. return $this->visibilityUser;
  347. }
  348. public function setVisibilityUser(?bool $visibilityUser): self
  349. {
  350. $this->visibilityUser = $visibilityUser;
  351. return $this;
  352. }
  353. public function getOnlyVisitor(): ?bool
  354. {
  355. return $this->onlyVisitor;
  356. }
  357. public function setOnlyVisitor(?bool $onlyVisitor): self
  358. {
  359. $this->onlyVisitor = $onlyVisitor;
  360. return $this;
  361. }
  362. public function getVisibilityTitle(): ?bool
  363. {
  364. return $this->visibilityTitle;
  365. }
  366. public function setVisibilityTitle(?bool $visibilityTitle): self
  367. {
  368. $this->visibilityTitle = $visibilityTitle;
  369. return $this;
  370. }
  371. public function getVisibilityDate(): ?bool
  372. {
  373. return $this->visibilityDate;
  374. }
  375. public function setVisibilityDate(?bool $visibilityDate): self
  376. {
  377. $this->visibilityDate = $visibilityDate;
  378. return $this;
  379. }
  380. public function getStartPage(): ?bool
  381. {
  382. return $this->startPage;
  383. }
  384. public function setStartPage(?bool $startPage): self
  385. {
  386. $this->startPage = $startPage;
  387. return $this;
  388. }
  389. public function getPage(): ?Pages
  390. {
  391. return $this->page;
  392. }
  393. public function setPage(?Pages $page): self
  394. {
  395. $this->page = $page;
  396. return $this;
  397. }
  398. public function getSaveTemplate(): ?SaveTemplates
  399. {
  400. return $this->saveTemplate;
  401. }
  402. public function setSaveTemplate(?SaveTemplates $saveTemplate): self
  403. {
  404. $this->saveTemplate = $saveTemplate;
  405. return $this;
  406. }
  407. public function isHtml(): ?bool
  408. {
  409. return $this->html;
  410. }
  411. public function isVisibilityUser(): ?bool
  412. {
  413. return $this->visibilityUser;
  414. }
  415. public function isOnlyVisitor(): ?bool
  416. {
  417. return $this->onlyVisitor;
  418. }
  419. public function isVisibilityTitle(): ?bool
  420. {
  421. return $this->visibilityTitle;
  422. }
  423. public function isVisibilityDate(): ?bool
  424. {
  425. return $this->visibilityDate;
  426. }
  427. public function isStartPage(): ?bool
  428. {
  429. return $this->startPage;
  430. }
  431. }