src/Entity/Pages/Pages.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Pages;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Symfony\Component\HttpFoundation\File\UploadedFile;
  7. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  8. /**
  9. * Pages
  10. *
  11. * @ORM\Table("pages_pages")
  12. * @ORM\Entity(repositoryClass="App\Repository\Pages\PagesRepository")
  13. * @ORM\HasLifecycleCallbacks()
  14. * @Vich\Uploadable
  15. */
  16. class Pages
  17. {
  18. /**
  19. * @var integer
  20. *
  21. * @ORM\Column(name="id", type="integer")
  22. * @ORM\Id
  23. * @ORM\GeneratedValue(strategy="AUTO")
  24. */
  25. protected $id;
  26. /**
  27. * @var string
  28. *
  29. * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  30. */
  31. private $createdAt;
  32. /**
  33. * @var string
  34. *
  35. * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  36. */
  37. private $updatedAt;
  38. /**
  39. * @var string
  40. *
  41. * @ORM\Column(name="name", type="string", length=255, nullable=true)
  42. */
  43. private $name;
  44. /**
  45. * @var string
  46. *
  47. * @ORM\Column(name="folder_slug", type="string", length=255, nullable=true)
  48. */
  49. private $folderSlug;
  50. /**
  51. * @var string
  52. *
  53. * @ORM\Column(name="folder_slug2", type="string", length=255, nullable=true)
  54. */
  55. private $folderSlug2;
  56. /**
  57. * @var string
  58. *
  59. * @ORM\Column(name="folder_slug3", type="string", length=255, nullable=true)
  60. */
  61. private $folderSlug3;
  62. /**
  63. * @var string
  64. *
  65. * @ORM\Column(name="title", type="string", length=255, nullable=true)
  66. */
  67. private $title;
  68. /**
  69. * @var string
  70. *
  71. * @ORM\Column(name="short_title", type="string", length=255, nullable=true)
  72. */
  73. private $shortTitle;
  74. /**
  75. * @var string
  76. *
  77. * @ORM\Column(name="description", type="text", nullable=true)
  78. */
  79. private $description;
  80. /**
  81. * @var string
  82. *
  83. * @ORM\Column(name="short_description", type="text", nullable=true)
  84. */
  85. private $shortDescription;
  86. /**
  87. * @var string
  88. *
  89. * @ORM\Column(name="views", type="integer", nullable=true)
  90. */
  91. private $views;
  92. /**
  93. * @var string
  94. *
  95. * @ORM\Column(name="locale", type="string", length=11, nullable=true)
  96. */
  97. private $locale;
  98. /**
  99. * @var string
  100. *
  101. * @ORM\Column(name="noblock", type="boolean", nullable=true)
  102. */
  103. private $noblock;
  104. /**
  105. * @var string
  106. *
  107. * @ORM\Column(name="robots", type="string", length=255, nullable=true)
  108. */
  109. private $robots;
  110. /**
  111. * @var string
  112. *
  113. * @ORM\Column(name="type", type="string", length=255, nullable=true)
  114. */
  115. private $type;
  116. /**
  117. * @var string
  118. *
  119. * @ORM\Column(name="sitemap", type="boolean", nullable=true)
  120. */
  121. private $sitemap;
  122. /**
  123. * @var string
  124. *
  125. * @ORM\Column(name="menu_absolute", type="boolean", nullable=true)
  126. */
  127. private $menuAbsolute;
  128. /**
  129. * @var string
  130. *
  131. * @ORM\Column(name="theme", type="string", length=255, nullable=true)
  132. */
  133. private $theme;
  134. /**
  135. * @var string
  136. *
  137. * @ORM\Column(name="style", type="text", nullable=true)
  138. */
  139. private $style;
  140. /**
  141. * @var string
  142. *
  143. * @ORM\Column(name="javascript", type="text", nullable=true)
  144. */
  145. private $javascript;
  146. /**
  147. * @var string
  148. *
  149. * @ORM\Column(name="redirect", type="text", nullable=true)
  150. */
  151. private $redirect;
  152. /**
  153. * @var string
  154. *
  155. * @ORM\Column(name="identifiant", type="string", length=255, nullable=true)
  156. */
  157. private $identifiant;
  158. /**
  159. * NOTE: This is not a mapped field of entity metadata, just a simple property.
  160. *
  161. * @Vich\UploadableField(mapping="pages_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions")
  162. *
  163. * @var File|null
  164. */
  165. private $imageFile;
  166. /**
  167. * @ORM\Embedded(class="Vich\UploaderBundle\Entity\File")
  168. *
  169. * @var EmbeddedFile
  170. */
  171. private $image;
  172. /**
  173. * @var string
  174. *
  175. * @ORM\Column(name="sequence", type="integer", length=11, nullable=true)
  176. */
  177. private $sequence;
  178. /**
  179. * @var string
  180. *
  181. * @ORM\Column(name="canonical", type="text", nullable=true)
  182. */
  183. private $canonical;
  184. /**
  185. * @var string
  186. *
  187. * @ORM\Column(name="author", type="string", length=155, nullable=true)
  188. */
  189. private $author;
  190. /**
  191. * @var string
  192. *
  193. * @ORM\Column(name="premium", type="boolean", nullable=true)
  194. */
  195. private $premium;
  196. /**
  197. * @var string
  198. *
  199. * @ORM\Column(name="navbar", type="string", length=155, nullable=true)
  200. */
  201. private $navbar;
  202. /**
  203. * @var string
  204. *
  205. * @ORM\Column(name="navbar_background_color", type="string", length=155, nullable=true)
  206. */
  207. private $navbarBG;
  208. public function __construct() {
  209. $this->image = new \Vich\UploaderBundle\Entity\File();
  210. }
  211. /**
  212. * @ORM\PrePersist
  213. */
  214. public function setCreatedAtValue(): void
  215. {
  216. $this->setCreatedAt(new \DateTime("now"));
  217. $this->setUpdatedAt(new \DateTime("now"));
  218. $this->setViews(0);
  219. $this->setType("brouillon");
  220. $this->setPremium(false);
  221. }
  222. /**
  223. * @ORM\PreUpdate
  224. */
  225. public function setUpdatedAtValue(): void
  226. {
  227. $this->setUpdatedAt(new \DateTime("now"));
  228. }
  229. public function __toString()
  230. {
  231. return (string)$this->title;
  232. }
  233. /**
  234. * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  235. * of 'UploadedFile' is injected into this setter to trigger the update. If this
  236. * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  237. * must be able to accept an instance of 'File' as the bundle will inject one here
  238. * during Doctrine hydration.
  239. *
  240. * @param File|UploadedFile|null $imageFile
  241. */
  242. public function setImageFile(?File $imageFile = null)
  243. {
  244. $this->imageFile = $imageFile;
  245. if (null !== $imageFile) {
  246. // It is required that at least one field changes if you are using doctrine
  247. // otherwise the event listeners won't be called and the file is lost
  248. $this->setUpdatedAt(new \DateTime("now"));
  249. }
  250. }
  251. public function getImageFile(): ?File
  252. {
  253. return $this->imageFile;
  254. }
  255. public function setImage(EmbeddedFile $image): void
  256. {
  257. $this->image = $image;
  258. }
  259. public function getImage(): ?EmbeddedFile
  260. {
  261. return $this->image;
  262. }
  263. public function getId(): ?int
  264. {
  265. return $this->id;
  266. }
  267. public function getCreatedAt(): ?\DateTimeInterface
  268. {
  269. return $this->createdAt;
  270. }
  271. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  272. {
  273. $this->createdAt = $createdAt;
  274. return $this;
  275. }
  276. public function getUpdatedAt(): ?\DateTimeInterface
  277. {
  278. return $this->updatedAt;
  279. }
  280. public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  281. {
  282. $this->updatedAt = $updatedAt;
  283. return $this;
  284. }
  285. public function getName(): ?string
  286. {
  287. return $this->name;
  288. }
  289. public function setName(?string $name): self
  290. {
  291. $this->name = $name;
  292. return $this;
  293. }
  294. public function getFolderSlug(): ?string
  295. {
  296. return $this->folderSlug;
  297. }
  298. public function setFolderSlug(?string $folderSlug): self
  299. {
  300. $this->folderSlug = $folderSlug;
  301. return $this;
  302. }
  303. public function getFolderSlug2(): ?string
  304. {
  305. return $this->folderSlug2;
  306. }
  307. public function setFolderSlug2(?string $folderSlug2): self
  308. {
  309. $this->folderSlug2 = $folderSlug2;
  310. return $this;
  311. }
  312. public function getFolderSlug3(): ?string
  313. {
  314. return $this->folderSlug3;
  315. }
  316. public function setFolderSlug3(?string $folderSlug3): self
  317. {
  318. $this->folderSlug3 = $folderSlug3;
  319. return $this;
  320. }
  321. public function getTitle(): ?string
  322. {
  323. return $this->title;
  324. }
  325. public function setTitle(?string $title): self
  326. {
  327. $this->title = $title;
  328. return $this;
  329. }
  330. public function getShortTitle(): ?string
  331. {
  332. return $this->shortTitle;
  333. }
  334. public function setShortTitle(?string $shortTitle): self
  335. {
  336. $this->shortTitle = $shortTitle;
  337. return $this;
  338. }
  339. public function getDescription(): ?string
  340. {
  341. return $this->description;
  342. }
  343. public function setDescription(?string $description): self
  344. {
  345. $this->description = $description;
  346. return $this;
  347. }
  348. public function getShortDescription(): ?string
  349. {
  350. return $this->shortDescription;
  351. }
  352. public function setShortDescription(?string $shortDescription): self
  353. {
  354. $this->shortDescription = $shortDescription;
  355. return $this;
  356. }
  357. public function getViews(): ?int
  358. {
  359. return $this->views;
  360. }
  361. public function setViews(?int $views): self
  362. {
  363. $this->views = $views;
  364. return $this;
  365. }
  366. public function getLocale(): ?string
  367. {
  368. return $this->locale;
  369. }
  370. public function setLocale(?string $locale): self
  371. {
  372. $this->locale = $locale;
  373. return $this;
  374. }
  375. public function getNoblock(): ?bool
  376. {
  377. return $this->noblock;
  378. }
  379. public function setNoblock(?bool $noblock): self
  380. {
  381. $this->noblock = $noblock;
  382. return $this;
  383. }
  384. public function getRobots(): ?string
  385. {
  386. return $this->robots;
  387. }
  388. public function setRobots(?string $robots): self
  389. {
  390. $this->robots = $robots;
  391. return $this;
  392. }
  393. public function getType(): ?string
  394. {
  395. return $this->type;
  396. }
  397. public function setType(?string $type): self
  398. {
  399. $this->type = $type;
  400. return $this;
  401. }
  402. public function getSitemap(): ?bool
  403. {
  404. return $this->sitemap;
  405. }
  406. public function setSitemap(?bool $sitemap): self
  407. {
  408. $this->sitemap = $sitemap;
  409. return $this;
  410. }
  411. public function getTheme(): ?string
  412. {
  413. return $this->theme;
  414. }
  415. public function setTheme(?string $theme): self
  416. {
  417. $this->theme = $theme;
  418. return $this;
  419. }
  420. public function getStyle(): ?string
  421. {
  422. return $this->style;
  423. }
  424. public function setStyle(?string $style): self
  425. {
  426. $this->style = $style;
  427. return $this;
  428. }
  429. public function getJavascript(): ?string
  430. {
  431. return $this->javascript;
  432. }
  433. public function setJavascript(?string $javascript): self
  434. {
  435. $this->javascript = $javascript;
  436. return $this;
  437. }
  438. public function getRedirect(): ?string
  439. {
  440. return $this->redirect;
  441. }
  442. public function setRedirect(?string $redirect): self
  443. {
  444. $this->redirect = $redirect;
  445. return $this;
  446. }
  447. public function getIdentifiant(): ?string
  448. {
  449. return $this->identifiant;
  450. }
  451. public function setIdentifiant(?string $identifiant): self
  452. {
  453. $this->identifiant = $identifiant;
  454. return $this;
  455. }
  456. public function getSequence(): ?int
  457. {
  458. return $this->sequence;
  459. }
  460. public function setSequence(?int $sequence): self
  461. {
  462. $this->sequence = $sequence;
  463. return $this;
  464. }
  465. public function getCanonical(): ?string
  466. {
  467. return $this->canonical;
  468. }
  469. public function setCanonical(?string $canonical): self
  470. {
  471. $this->canonical = $canonical;
  472. return $this;
  473. }
  474. public function getAuthor(): ?string
  475. {
  476. return $this->author;
  477. }
  478. public function setAuthor(?string $author): self
  479. {
  480. $this->author = $author;
  481. return $this;
  482. }
  483. public function getMenuAbsolute(): ?bool
  484. {
  485. return $this->menuAbsolute;
  486. }
  487. public function setMenuAbsolute(?bool $menuAbsolute): self
  488. {
  489. $this->menuAbsolute = $menuAbsolute;
  490. return $this;
  491. }
  492. public function getPremium(): ?bool
  493. {
  494. return $this->premium;
  495. }
  496. public function setPremium(?bool $premium): self
  497. {
  498. $this->premium = $premium;
  499. return $this;
  500. }
  501. public function getNavbar(): ?string
  502. {
  503. return $this->navbar;
  504. }
  505. public function setNavbar(?string $navbar): self
  506. {
  507. $this->navbar = $navbar;
  508. return $this;
  509. }
  510. public function getNavbarBG(): ?string
  511. {
  512. return $this->navbarBG;
  513. }
  514. public function setNavbarBG(?string $navbar): self
  515. {
  516. $this->navbarBG = $navbar;
  517. return $this;
  518. }
  519. public function isNoblock(): ?bool
  520. {
  521. return $this->noblock;
  522. }
  523. public function isSitemap(): ?bool
  524. {
  525. return $this->sitemap;
  526. }
  527. public function isMenuAbsolute(): ?bool
  528. {
  529. return $this->menuAbsolute;
  530. }
  531. public function isPremium(): ?bool
  532. {
  533. return $this->premium;
  534. }
  535. }