src/Entity/Pages/Pages.php line 23

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