src/Entity/Articles/Articles.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use App\Entity\Jobs\Database;
  4. use Doctrine\DBAL\Types\Types;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. use App\Repository\Articles\ArticlesRepository;
  12. use Symfony\Component\HttpFoundation\File\UploadedFile;
  13. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  14. /**
  15. * Articles
  16. *
  17. * @ORM\Table("articles_articles")
  18. * @ORM\Entity(repositoryClass=ArticlesRepository::class)
  19. * @ORM\HasLifecycleCallbacks()
  20. * @Vich\Uploadable
  21. */
  22. class Articles {
  23. /**
  24. * @var integer
  25. *
  26. * @ORM\Column(name="id", type="integer")
  27. * @ORM\Id
  28. * @ORM\GeneratedValue(strategy="AUTO")
  29. * [Groups(['list', 'item'])]
  30. */
  31. protected $id;
  32. /**
  33. * @var string
  34. *
  35. * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  36. */
  37. private $createdAt;
  38. /**
  39. * @var string
  40. *
  41. * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  42. */
  43. private $updatedAt;
  44. /**
  45. * @var string
  46. *
  47. * @ORM\Column(name="published_at", type="datetime", nullable=true)
  48. * [Groups(['list', 'item'])]
  49. */
  50. private $publishedAt;
  51. /**
  52. * @var string
  53. *
  54. * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  55. */
  56. private $slug;
  57. /**
  58. * @var string
  59. *
  60. * @ORM\Column(name="title", type="string", length=500, nullable=true)
  61. * [Groups(['list', 'item'])]
  62. */
  63. private $title;
  64. /**
  65. * @var string
  66. *
  67. * @ORM\Column(name="title_link", type="string", length=500, nullable=true)
  68. * [Groups(['list', 'item'])]
  69. */
  70. private $titleLink;
  71. /**
  72. * @var string
  73. *
  74. * @ORM\Column(name="shortTitle", type="string", length=500, nullable=true)
  75. */
  76. private $shortTitle;
  77. /**
  78. * @var string
  79. *
  80. * @ORM\Column(name="subtitle", type="string", length=500, nullable=true)
  81. */
  82. private $subtitle;
  83. /**
  84. * @var string
  85. *
  86. * @ORM\Column(name="type", type="string", length=500, nullable=true)
  87. */
  88. private $type;
  89. /**
  90. * @var string
  91. *
  92. * @ORM\Column(name="short_description", type="text", nullable=true)
  93. */
  94. private $shortDescription;
  95. /**
  96. * @var string
  97. *
  98. * @ORM\Column(name="description", type="text", nullable=true)
  99. * [Groups(['list', 'item'])]
  100. */
  101. private $description;
  102. /**
  103. * @var string
  104. *
  105. * @ORM\Column(name="description_start", type="text", nullable=true)
  106. * [Groups(['list', 'item'])]
  107. */
  108. private $descriptionStart;
  109. /**
  110. * NOTE: This is not a mapped field of entity metadata, just a simple property.
  111. *
  112. * @Vich\UploadableField(mapping="articles_files", fileNameProperty="image.name", size="image.size", mimeType="image.mimeType", originalName="image.originalName", dimensions="image.dimensions")
  113. * @Assert\File(
  114. * maxSize = "8M",
  115. * mimeTypes={"image/jpeg", "image/png", "image/webp"},
  116. * mimeTypesMessage = "Please upload a valid PDF or image"
  117. * )
  118. * @var File|null
  119. */
  120. private $imageFile;
  121. /**
  122. * @ORM\Embedded(class="Vich\UploaderBundle\Entity\File")
  123. *
  124. * @var EmbeddedFile
  125. */
  126. private $image;
  127. /**
  128. * @var string
  129. *
  130. * @ORM\Column(name="image_alt", type="string", length=500, nullable=true)
  131. */
  132. private $imageAlt;
  133. /**
  134. * @var string
  135. *
  136. * @ORM\Column(name="image_title", type="string", length=500, nullable=true)
  137. */
  138. private $imageTitle;
  139. /**
  140. * @var string
  141. *
  142. * @ORM\Column(name="visibility", type="boolean", nullable=true)
  143. */
  144. private $visibility;
  145. /**
  146. * @var string
  147. *
  148. * @ORM\Column(name="autopublished_at", type="datetime", nullable=true)
  149. */
  150. private $autopublishedAt;
  151. /**
  152. * @var string
  153. *
  154. * @ORM\Column(name="sitemap", type="boolean", nullable=true)
  155. */
  156. private $sitemap;
  157. /**
  158. * @var string
  159. *
  160. * @ORM\Column(name="robots", type="string", length=255, nullable=true)
  161. */
  162. private $robots;
  163. /**
  164. * @var string
  165. *
  166. * @ORM\Column(name="canonical", type="string", length=500, nullable=true)
  167. */
  168. private $canonical;
  169. /**
  170. * @var string
  171. *
  172. * @ORM\Column(name="author", type="string", length=155, nullable=true)
  173. */
  174. private $author;
  175. /**
  176. * @var string
  177. *
  178. * @ORM\Column(name="url", type="string", length=500, nullable=true)
  179. */
  180. private $url;
  181. /**
  182. * @var string
  183. *
  184. * @ORM\Column(name="recruiter", type="boolean", nullable=true)
  185. */
  186. private $recruiter;
  187. /**
  188. * @var string
  189. *
  190. * @ORM\Column(name="company", type="boolean", nullable=true)
  191. */
  192. private $company;
  193. /**
  194. * @var string
  195. *
  196. * @ORM\Column(name="website", type="boolean", nullable=true)
  197. */
  198. private $website;
  199. /**
  200. * @var string
  201. *
  202. * @ORM\Column(name="locale", type="string", length=11, nullable=true)
  203. */
  204. private $locale;
  205. /**
  206. * @var string
  207. *
  208. * @ORM\Column(name="banner_title", type="text", nullable=true)
  209. * [Groups(['list', 'item'])]
  210. */
  211. private $bannerTitle;
  212. /**
  213. * @var string
  214. *
  215. * @ORM\Column(name="banner_description", type="text", nullable=true)
  216. * [Groups(['list', 'item'])]
  217. */
  218. private $bannerDescription;
  219. /**
  220. * @var string
  221. *
  222. * @ORM\Column(name="banner_link", type="text", nullable=true)
  223. * [Groups(['list', 'item'])]
  224. */
  225. private $bannerLink;
  226. /**
  227. * @var string
  228. *
  229. * @ORM\Column(name="banner_button", type="text", nullable=true)
  230. * [Groups(['list', 'item'])]
  231. */
  232. private $bannerButton;
  233. /**
  234. * @var string
  235. *
  236. * @ORM\Column(name="pageslug", type="string", length=255, nullable=true)
  237. */
  238. private $pageSlug;
  239. /**
  240. * @var string
  241. *
  242. * @ORM\Column(name="pageslug2", type="string", length=255, nullable=true)
  243. */
  244. private $pageSlug2;
  245. /**
  246. * @var string
  247. *
  248. * @ORM\Column(name="pageslug3", type="string", length=255, nullable=true)
  249. */
  250. private $pageSlug3;
  251. /**
  252. * @var string
  253. *
  254. * @ORM\Column(name="onlyPage", type="boolean", nullable=true)
  255. */
  256. private $onlyPage;
  257. /**
  258. * @var string
  259. *
  260. * @ORM\Column(name="onlyArticles", type="boolean", nullable=true)
  261. */
  262. private $onlyArticles;
  263. /**
  264. * @var string
  265. *
  266. * @ORM\Column(name="recruiterDirectory", type="boolean", nullable=true)
  267. */
  268. private $recruiterDirectory;
  269. /**
  270. * @var string
  271. *
  272. * @ORM\Column(name="employerDirectory", type="boolean", nullable=true)
  273. */
  274. private $employerDirectory;
  275. /**
  276. * @var string
  277. *
  278. * @ORM\Column(name="title_ariane", type="string", length=500, nullable=true)
  279. */
  280. private $titleAriane;
  281. /**
  282. * @var string
  283. *
  284. * @ORM\Column(name="identifiant", type="string", length=500, nullable=true)
  285. */
  286. private $identifiant;
  287. /**
  288. * @var string
  289. *
  290. * @ORM\Column(name="keyword", type="string", length=500, nullable=true)
  291. */
  292. private $keyword;
  293. /**
  294. * @var string
  295. *
  296. * @ORM\Column(name="months_update", type="string", length=500, nullable=true)
  297. */
  298. private $monthsUpdate;
  299. /**
  300. * @var string
  301. *
  302. * @ORM\Column(name="volume", type="string", length=500, nullable=true)
  303. */
  304. private $volume;
  305. /**
  306. * @var string
  307. *
  308. * @ORM\Column(name="links_info", type="boolean", nullable=true)
  309. */
  310. private $links;
  311. /**
  312. * @var string
  313. *
  314. * @ORM\Column(name="schema_info", type="boolean", nullable=true)
  315. */
  316. private $schema;
  317. /**
  318. * @var string
  319. *
  320. * @ORM\Column(name="video_info", type="boolean", nullable=true)
  321. */
  322. private $video;
  323. /**
  324. * @var \ArticlesHasCategories
  325. *
  326. * @ORM\ManyToOne(targetEntity="ArticlesHasCategories")
  327. * @ORM\JoinColumns({
  328. * @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
  329. * })
  330. */
  331. protected $category;
  332. /**
  333. * @var \ArticlesAuthors
  334. *
  335. * @ORM\ManyToOne(targetEntity="ArticlesAuthors")
  336. * @ORM\JoinColumns({
  337. * @ORM\JoinColumn(name="author_article_id", referencedColumnName="id", nullable=true)
  338. * })
  339. */
  340. protected $authorArticle;
  341. /**
  342. * @var string
  343. *
  344. * @ORM\Column(name="message_alert", type="text", nullable=true)
  345. */
  346. private $messageAlert;
  347. /**
  348. * @var string
  349. *
  350. * @ORM\Column(name="editor_html", type="boolean", nullable=true)
  351. */
  352. private $editorHTML;
  353. public function __construct()
  354. {
  355. $this->image = new \Vich\UploaderBundle\Entity\File();
  356. }
  357. /**
  358. * @ORM\PrePersist
  359. */
  360. public function setCreatedAtValue(): void
  361. {
  362. $this->setCreatedAt(new \DateTime("now"));
  363. $this->setUpdatedAt(new \DateTime("now"));
  364. $this->visibility = false;
  365. }
  366. /**
  367. * @ORM\PreUpdate
  368. */
  369. public function setUpdatedAtValue(): void
  370. {
  371. $this->setUpdatedAt(new \DateTime("now"));
  372. }
  373. public function __toString()
  374. {
  375. return $this->title;
  376. }
  377. /**
  378. * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  379. * of 'UploadedFile' is injected into this setter to trigger the update. If this
  380. * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  381. * must be able to accept an instance of 'File' as the bundle will inject one here
  382. * during Doctrine hydration.
  383. *
  384. * @param File|UploadedFile|null $imageFile
  385. */
  386. public function setImageFile(?File $imageFile = null)
  387. {
  388. $this->imageFile = $imageFile;
  389. if (null !== $imageFile) {
  390. // It is required that at least one field changes if you are using doctrine
  391. // otherwise the event listeners won't be called and the file is lost
  392. $this->setUpdatedAt(new \DateTime("now"));
  393. }
  394. }
  395. public function getImageFile(): ?File
  396. {
  397. return $this->imageFile;
  398. }
  399. public function setImage(EmbeddedFile $image): void
  400. {
  401. $this->image = $image;
  402. }
  403. public function getImage(): ?EmbeddedFile
  404. {
  405. return $this->image;
  406. }
  407. public function getId(): ?int
  408. {
  409. return $this->id;
  410. }
  411. public function getCreatedAt(): ?\DateTimeInterface
  412. {
  413. return $this->createdAt;
  414. }
  415. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  416. {
  417. $this->createdAt = $createdAt;
  418. return $this;
  419. }
  420. public function getUpdatedAt(): ?\DateTimeInterface
  421. {
  422. return $this->updatedAt;
  423. }
  424. public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  425. {
  426. $this->updatedAt = $updatedAt;
  427. return $this;
  428. }
  429. public function getPublishedAt(): ?\DateTimeInterface
  430. {
  431. return $this->publishedAt;
  432. }
  433. public function setPublishedAt(?\DateTimeInterface $publishedAt): self
  434. {
  435. $this->publishedAt = $publishedAt;
  436. return $this;
  437. }
  438. public function getSlug(): ?string
  439. {
  440. return $this->slug;
  441. }
  442. public function setSlug(?string $slug): self
  443. {
  444. $this->slug = $slug;
  445. return $this;
  446. }
  447. public function getTitle(): ?string
  448. {
  449. return $this->title;
  450. }
  451. public function setTitle(?string $title): self
  452. {
  453. $this->title = $title;
  454. return $this;
  455. }
  456. public function getTitleLink(): ?string
  457. {
  458. return $this->titleLink;
  459. }
  460. public function setTitleLink(?string $title): self
  461. {
  462. $this->titleLink = $title;
  463. return $this;
  464. }
  465. public function getShortTitle(): ?string
  466. {
  467. return $this->shortTitle;
  468. }
  469. public function setShortTitle(?string $shortTitle): self
  470. {
  471. $this->shortTitle = $shortTitle;
  472. return $this;
  473. }
  474. public function getSubtitle(): ?string
  475. {
  476. return $this->subtitle;
  477. }
  478. public function setSubtitle(?string $subtitle): self
  479. {
  480. $this->subtitle = $subtitle;
  481. return $this;
  482. }
  483. public function getType(): ?string
  484. {
  485. return $this->type;
  486. }
  487. public function setType(?string $type): self
  488. {
  489. $this->type = $type;
  490. return $this;
  491. }
  492. public function getShortDescription(): ?string
  493. {
  494. return $this->shortDescription;
  495. }
  496. public function setShortDescription(?string $shortDescription): self
  497. {
  498. $this->shortDescription = $shortDescription;
  499. return $this;
  500. }
  501. public function getDescription(): ?string
  502. {
  503. return $this->description;
  504. }
  505. public function setDescription(?string $description): self
  506. {
  507. $this->description = $description;
  508. return $this;
  509. }
  510. public function getDescriptionStart(): ?string
  511. {
  512. return $this->descriptionStart;
  513. }
  514. public function setDescriptionStart(?string $descriptionStart): self
  515. {
  516. $this->descriptionStart = $descriptionStart;
  517. return $this;
  518. }
  519. public function getVisibility(): ?bool
  520. {
  521. return $this->visibility;
  522. }
  523. public function setVisibility(?bool $visibility): self
  524. {
  525. $this->visibility = $visibility;
  526. return $this;
  527. }
  528. public function getAutopublishedAt(): ?\DateTimeInterface
  529. {
  530. return $this->autopublishedAt;
  531. }
  532. public function setAutopublishedAt(?\DateTimeInterface $autopublishedAt): self
  533. {
  534. $this->autopublishedAt = $autopublishedAt;
  535. return $this;
  536. }
  537. public function getSitemap(): ?bool
  538. {
  539. return $this->sitemap;
  540. }
  541. public function setSitemap(?bool $sitemap): self
  542. {
  543. $this->sitemap = $sitemap;
  544. return $this;
  545. }
  546. public function getRobots(): ?string
  547. {
  548. return $this->robots;
  549. }
  550. public function setRobots(?string $robots): self
  551. {
  552. $this->robots = $robots;
  553. return $this;
  554. }
  555. public function getCanonical(): ?string
  556. {
  557. return $this->canonical;
  558. }
  559. public function setCanonical(?string $canonical): self
  560. {
  561. $this->canonical = $canonical;
  562. return $this;
  563. }
  564. public function getAuthor(): ?string
  565. {
  566. return $this->author;
  567. }
  568. public function setAuthor(?string $author): self
  569. {
  570. $this->author = $author;
  571. return $this;
  572. }
  573. public function getUrl(): ?string
  574. {
  575. return $this->url;
  576. }
  577. public function setUrl(?string $url): self
  578. {
  579. $this->url = $url;
  580. return $this;
  581. }
  582. public function getRecruiter(): ?bool
  583. {
  584. return $this->recruiter;
  585. }
  586. public function setRecruiter(?bool $recruiter): self
  587. {
  588. $this->recruiter = $recruiter;
  589. return $this;
  590. }
  591. public function getCompany(): ?bool
  592. {
  593. return $this->company;
  594. }
  595. public function setCompany(?bool $company): self
  596. {
  597. $this->company = $company;
  598. return $this;
  599. }
  600. public function getWebsite(): ?bool
  601. {
  602. return $this->website;
  603. }
  604. public function setWebsite(?bool $website): self
  605. {
  606. $this->website = $website;
  607. return $this;
  608. }
  609. public function getLocale(): ?string
  610. {
  611. return $this->locale;
  612. }
  613. public function setLocale(?string $locale): self
  614. {
  615. $this->locale = $locale;
  616. return $this;
  617. }
  618. public function isVisibility(): ?bool
  619. {
  620. return $this->visibility;
  621. }
  622. public function isSitemap(): ?bool
  623. {
  624. return $this->sitemap;
  625. }
  626. public function isRecruiter(): ?bool
  627. {
  628. return $this->recruiter;
  629. }
  630. public function isCompany(): ?bool
  631. {
  632. return $this->company;
  633. }
  634. public function isWebsite(): ?bool
  635. {
  636. return $this->website;
  637. }
  638. public function getBannerDescription(): ?string
  639. {
  640. return $this->bannerDescription;
  641. }
  642. public function setBannerDescription(?string $description): self
  643. {
  644. $this->bannerDescription = $description;
  645. return $this;
  646. }
  647. public function getBannerLink(): ?string
  648. {
  649. return $this->bannerLink;
  650. }
  651. public function setBannerLink(?string $description): self
  652. {
  653. $this->bannerLink = $description;
  654. return $this;
  655. }
  656. public function getBannerTitle(): ?string
  657. {
  658. return $this->bannerTitle;
  659. }
  660. public function setBannerTitle(?string $description): self
  661. {
  662. $this->bannerTitle = $description;
  663. return $this;
  664. }
  665. public function getBannerButton(): ?string
  666. {
  667. return $this->bannerButton;
  668. }
  669. public function setBannerButton(?string $description): self
  670. {
  671. $this->bannerButton = $description;
  672. return $this;
  673. }
  674. public function getImageTitle(): ?string
  675. {
  676. return $this->imageTitle;
  677. }
  678. public function setImageTitle(?string $imageTitle): self
  679. {
  680. $this->imageTitle = $imageTitle;
  681. return $this;
  682. }
  683. public function getImageAlt(): ?string
  684. {
  685. return $this->imageAlt;
  686. }
  687. public function setImageAlt(?string $imageAlt): self
  688. {
  689. $this->imageAlt = $imageAlt;
  690. return $this;
  691. }
  692. public function getPageSlug(): ?string
  693. {
  694. return $this->pageSlug;
  695. }
  696. public function setPageSlug(?string $pageSlug): static
  697. {
  698. $this->pageSlug = $pageSlug;
  699. return $this;
  700. }
  701. public function getPageSlug2(): ?string
  702. {
  703. return $this->pageSlug2;
  704. }
  705. public function setPageSlug2(?string $pageSlug2): static
  706. {
  707. $this->pageSlug2 = $pageSlug2;
  708. return $this;
  709. }
  710. public function getPageSlug3(): ?string
  711. {
  712. return $this->pageSlug3;
  713. }
  714. public function setPageSlug3(?string $pageSlug3): static
  715. {
  716. $this->pageSlug3 = $pageSlug3;
  717. return $this;
  718. }
  719. public function isOnlyPage(): ?bool
  720. {
  721. return $this->onlyPage;
  722. }
  723. public function setOnlyPage(?bool $onlyPage): static
  724. {
  725. $this->onlyPage = $onlyPage;
  726. return $this;
  727. }
  728. public function isOnlyArticles(): ?bool
  729. {
  730. return $this->onlyArticles;
  731. }
  732. public function setOnlyArticles(?bool $onlyArticles): static
  733. {
  734. $this->onlyArticles = $onlyArticles;
  735. return $this;
  736. }
  737. public function getTitleAriane(): ?string
  738. {
  739. return $this->titleAriane;
  740. }
  741. public function setTitleAriane(?string $titleAriane): static
  742. {
  743. $this->titleAriane = $titleAriane;
  744. return $this;
  745. }
  746. public function getCategory(): ?ArticlesHasCategories
  747. {
  748. return $this->category;
  749. }
  750. public function setCategory(?ArticlesHasCategories $category): static
  751. {
  752. $this->category = $category;
  753. return $this;
  754. }
  755. public function getIdentifiant(): ?string
  756. {
  757. return $this->identifiant;
  758. }
  759. public function setIdentifiant(?string $identifiant): static
  760. {
  761. $this->identifiant = $identifiant;
  762. return $this;
  763. }
  764. public function getKeyword(): ?string
  765. {
  766. return $this->keyword;
  767. }
  768. public function setKeyword(?string $keyword): static
  769. {
  770. $this->keyword = $keyword;
  771. return $this;
  772. }
  773. public function getMonthsUpdate(): ?string
  774. {
  775. return $this->monthsUpdate;
  776. }
  777. public function setMonthsUpdate(?string $monthsUpdate): static
  778. {
  779. $this->monthsUpdate = $monthsUpdate;
  780. return $this;
  781. }
  782. public function isLinks(): ?bool
  783. {
  784. return $this->links;
  785. }
  786. public function setLinks(?bool $links): static
  787. {
  788. $this->links = $links;
  789. return $this;
  790. }
  791. public function isSchema(): ?bool
  792. {
  793. return $this->schema;
  794. }
  795. public function setSchema(?bool $schema): static
  796. {
  797. $this->schema = $schema;
  798. return $this;
  799. }
  800. public function isVideo(): ?bool
  801. {
  802. return $this->video;
  803. }
  804. public function setVideo(?bool $video): static
  805. {
  806. $this->video = $video;
  807. return $this;
  808. }
  809. public function getVolume(): ?string
  810. {
  811. return $this->volume;
  812. }
  813. public function setVolume(?string $keyword): static
  814. {
  815. $this->volume = $keyword;
  816. return $this;
  817. }
  818. public function isRecruiterDirectory(): ?bool
  819. {
  820. return $this->recruiterDirectory;
  821. }
  822. public function setRecruiterDirectory(?bool $recruiterDirectory): static
  823. {
  824. $this->recruiterDirectory = $recruiterDirectory;
  825. return $this;
  826. }
  827. public function isEmployerDirectory(): ?bool
  828. {
  829. return $this->employerDirectory;
  830. }
  831. public function setEmployerDirectory(?bool $employerDirectory): static
  832. {
  833. $this->employerDirectory = $employerDirectory;
  834. return $this;
  835. }
  836. public function getAuthorArticle(): ?ArticlesAuthors
  837. {
  838. return $this->authorArticle;
  839. }
  840. public function setAuthorArticle(?ArticlesAuthors $authorArticle): static
  841. {
  842. $this->authorArticle = $authorArticle;
  843. return $this;
  844. }
  845. public function getMessageAlert(): ?string
  846. {
  847. return $this->messageAlert;
  848. }
  849. public function setMessageAlert(?string $messageAlert): static
  850. {
  851. $this->messageAlert = $messageAlert;
  852. return $this;
  853. }
  854. public function isEditorHTML(): ?bool
  855. {
  856. return $this->editorHTML;
  857. }
  858. public function setEditorHTML(?bool $editorHTML): static
  859. {
  860. $this->editorHTML = $editorHTML;
  861. return $this;
  862. }
  863. }