src/Entity/BlogPost.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BlogPostRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. /**
  11.  * @ORM\Entity(repositoryClass=BlogPostRepository::class)
  12.  * @Vich\Uploadable
  13.  */
  14. class BlogPost implements WithQRCodeInterfacePositionedInterface
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=150, nullable=true)
  24.      */
  25.     private $title;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=false)
  28.      */
  29.     private $slug;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $description;
  34.     /**
  35.      * @return string|null
  36.      */
  37.     public function getTitle(): ?string
  38.     {
  39.         return $this->title;
  40.     }
  41.     /**
  42.      * @param string $title
  43.      * @return $this
  44.      */
  45.     public function setTitle(string $title): self
  46.     {
  47.         $this->title $title;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return string|null
  52.      */
  53.     public function getSlug(): ?string
  54.     {
  55.         return $this->slug;
  56.     }
  57.     /**
  58.      * @param string $slug
  59.      * @return $this
  60.      */
  61.     public function setSlug(string $slug): self
  62.     {
  63.         $this->slug $slug;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return string|null
  68.      */
  69.     public function getDescription(): ?string
  70.     {
  71.         return $this->description;
  72.     }
  73.     /**
  74.      * @param ?string $description
  75.      * @return $this
  76.      */
  77.     public function setDescription(?string $description): self
  78.     {
  79.         $this->description $description;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @ORM\Column(type="boolean")
  84.      */
  85.     private $isActivated false;
  86.     /**
  87.      * @ORM\Column(type="datetime")
  88.      */
  89.     private $createdAt;
  90.     /**
  91.      * @ORM\Column(type="datetime")
  92.      */
  93.     private $updatedAt;
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity=BlogPostCategory::class, inversedBy="blogPosts")
  96.      * @ORM\JoinColumn(nullable=false)
  97.      */
  98.     private $blogPostCategory;
  99.     /**
  100.      * @ORM\OneToOne(targetEntity=Seo::class, cascade={"persist", "remove"})
  101.      */
  102.     private $seo;
  103.     /**
  104.      * @ORM\Column(type="boolean", options={"default": false})
  105.      */
  106.     private $isFeatured false;
  107.     /**
  108.      * @ORM\Column(type="boolean", options={"default": false})
  109.      */
  110.     private $isFeaturedTitle false;
  111.     /**
  112.      * @ORM\OneToOne(targetEntity=Media::class, cascade={"persist"})
  113.      */
  114.     private $imagePreviewMedia;
  115.     /**
  116.      * @ORM\OneToOne(targetEntity=Media::class, cascade={"persist", "remove"})
  117.      */
  118.     private $featuringImageMedia;
  119.     /**
  120.      * @ORM\Column(type="boolean", options={"default": false}, nullable=true))
  121.      */
  122.     private $isPublic false;
  123.     /**
  124.      * @ORM\Column(type="integer")
  125.      */
  126.     private $position 0;
  127.     /**
  128.      * @ORM\Column(type="string", length=255, nullable=true)
  129.      */
  130.     private $qrCode;
  131.     /**
  132.      * @ORM\ManyToOne(targetEntity=Media::class, cascade={"persist", "remove"})
  133.      */
  134.     private $media;
  135.     /**
  136.      * @ORM\OneToOne(targetEntity=Media::class, cascade={"persist", "remove"})
  137.      */
  138.     private $previewVideo;
  139.     /**
  140.      * @ORM\OneToMany(targetEntity=BlogPostLike::class, mappedBy="blogPost", orphanRemoval=true)
  141.      */
  142.     private $likes;
  143.     /**
  144.      * @ORM\Column(type="datetime", nullable=true)
  145.      */
  146.     private $notificationSentAt;
  147.     /**
  148.      * @ORM\OneToOne(inversedBy="blogPost", targetEntity=BlogPostNotification::class, cascade={"persist", "remove"})
  149.      */
  150.     private $notification;
  151.     /**
  152.      * @ORM\Column(type="boolean", options={"default": false}, nullable=true)
  153.      */
  154.     private $isNotify;
  155.     /**
  156.      * @ORM\Column(type="boolean", options={"default": false}, nullable=true)
  157.      */
  158.     private $isScheduled false;
  159.     /**
  160.      * @ORM\OneToMany(targetEntity=BlogPostHistoryUpdate::class, mappedBy="blogPost", orphanRemoval=true)
  161.      */
  162.     private $blogPostHistoryUpdates;
  163.     /**
  164.      * @ORM\ManyToOne(targetEntity=Preference::class, inversedBy="blogPosts")
  165.      */
  166.     private $preference;
  167.     /**
  168.      * @ORM\ManyToMany(targetEntity=Roles::class)
  169.      */
  170.     private $roles;
  171.     /**
  172.      * @ORM\Column(type="datetime", nullable=true)
  173.      */
  174.     private $activation_date;
  175.     /**
  176.      * @ORM\Column(type="datetime", nullable=true)
  177.      */
  178.     private $desactivation_date;
  179.     /**
  180.      * @ORM\OneToMany(targetEntity=BlogPostGallery::class, mappedBy="blogPost", cascade={"remove"})
  181.      */
  182.     private $galleries;
  183.     /**
  184.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="blogPosts")
  185.      */
  186.     private $author;
  187.     /**
  188.      * @ORM\Column(type="boolean", nullable=true)
  189.      */
  190.     private $hasAllCriteria1;
  191.     /**
  192.      * @ORM\ManyToMany(targetEntity=Criteria1Item::class)
  193.      */
  194.     private $criteria1Items;
  195.     /**
  196.      * @ORM\Column(type="boolean", nullable=true)
  197.      */
  198.     private $hasAllCriteria2;
  199.     /**
  200.      * @ORM\ManyToMany(targetEntity=Criteria2Item::class)
  201.      */
  202.     private $criteria2Items;
  203.     /**
  204.      * @ORM\Column(type="boolean", nullable=true)
  205.      */
  206.     private $hasAllCriteria3;
  207.     /**
  208.      * @ORM\ManyToMany(targetEntity=Criteria3Item::class)
  209.      */
  210.     private $criteria3Items;
  211.     /**
  212.      * @ORM\OneToOne(targetEntity=ScoringQuiz::class, mappedBy="blogPost", cascade={"persist", "remove"})
  213.      */
  214.     private $scoringQuiz;
  215.     /**
  216.      * @ORM\OneToOne(targetEntity=IdentityForm::class, mappedBy="blogPost", cascade={"persist", "remove"})
  217.      */
  218.     private $identityForm;
  219.     /**
  220.      * @ORM\Column(type="string", length=255, nullable=true)
  221.      */
  222.     private $identityField1;
  223.     /**
  224.      * @ORM\Column(type="string", length=255, nullable=true)
  225.      */
  226.     private $identityField2;
  227.     /**
  228.      * @ORM\Column(type="string", length=255, nullable=true)
  229.      */
  230.     private $identityField3;
  231.     /**
  232.      * @ORM\Column(type="string", length=255, nullable=true)
  233.      */
  234.     private $identityField4;
  235.     /**
  236.      * @ORM\Column(type="string", length=255, nullable=true)
  237.      */
  238.     private $identityField5;
  239.     /**
  240.      * @ORM\Column(type="string", length=255, nullable=true)
  241.      */
  242.     private $identityField6;
  243.     /**
  244.      * @ORM\Column(type="string", length=255, nullable=true)
  245.      */
  246.     private $identityField7;
  247.     /**
  248.      * @ORM\Column(type="text", nullable=true)
  249.      */
  250.     private $identityTextarea;
  251.     /**
  252.      * @ORM\Column(type="string", nullable=true)
  253.      */
  254.     private $identityMedia;
  255.     /**
  256.      * @Vich\UploadableField(mapping="identity_media", fileNameProperty="identityMedia")
  257.      * @var File|null
  258.      */
  259.     private $identityMediaFile;
  260.     /**
  261.      * @ORM\OneToMany(targetEntity=UserIdentityForm::class, mappedBy="blogPost", cascade={"persist", "remove"}, orphanRemoval=true)
  262.      */
  263.     private $userIdentityForms;
  264.     public function __construct()
  265.     {
  266.         $this->createdAt = new \DateTime();
  267.         $this->updatedAt = new \DateTime();
  268.         $this->likes = new ArrayCollection();
  269.         $this->blogPostHistoryUpdates = new ArrayCollection();
  270.         $this->roles = new ArrayCollection();
  271.         $this->galleries = new ArrayCollection();
  272.         $this->criteria1Items = new ArrayCollection();
  273.         $this->criteria2Items = new ArrayCollection();
  274.         $this->criteria3Items = new ArrayCollection();
  275.         $this->userIdentityForms = new ArrayCollection();
  276.     }
  277.     /**
  278.      * @return int|null
  279.      */
  280.     public function getId(): ?int
  281.     {
  282.         return $this->id;
  283.     }
  284.     /**
  285.      * @return bool|null
  286.      */
  287.     public function getIsActivated(): ?bool
  288.     {
  289.         return $this->isActivated;
  290.     }
  291.     /**
  292.      * @param bool $isActivated
  293.      * @return $this
  294.      */
  295.     public function setIsActivated(bool $isActivated): self
  296.     {
  297.         $this->isActivated $isActivated;
  298.         return $this;
  299.     }
  300.     /**
  301.      * @return \DateTimeInterface|null
  302.      */
  303.     public function getCreatedAt(): ?\DateTimeInterface
  304.     {
  305.         return $this->createdAt;
  306.     }
  307.     /**
  308.      * @param \DateTimeInterface $createdAt
  309.      * @return $this
  310.      */
  311.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  312.     {
  313.         $this->createdAt $createdAt;
  314.         return $this;
  315.     }
  316.     /**
  317.      * @return \DateTimeInterface|null
  318.      */
  319.     public function getUpdatedAt(): ?\DateTimeInterface
  320.     {
  321.         return $this->updatedAt;
  322.     }
  323.     /**
  324.      * @param \DateTimeInterface $updatedAt
  325.      * @return $this
  326.      */
  327.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  328.     {
  329.         $this->updatedAt $updatedAt;
  330.         return $this;
  331.     }
  332.     public function getBlogPostCategory(): ?BlogPostCategory
  333.     {
  334.         return $this->blogPostCategory;
  335.     }
  336.     public function setBlogPostCategory(?BlogPostCategory $blogPostCategory): self
  337.     {
  338.         $this->blogPostCategory $blogPostCategory;
  339.         return $this;
  340.     }
  341.     public function __toString(): string
  342.     {
  343.         return $this->getTitle() ?? '';
  344.     }
  345.     public function getSeo(): ?Seo
  346.     {
  347.         return $this->seo;
  348.     }
  349.     public function setSeo(?Seo $seo): self
  350.     {
  351.         $this->seo $seo;
  352.         return $this;
  353.     }
  354.     public function getIsFeatured(): ?bool
  355.     {
  356.         return $this->isFeatured;
  357.     }
  358.     public function setIsFeatured(bool $isFeatured): self
  359.     {
  360.         $this->isFeatured $isFeatured;
  361.         return $this;
  362.     }
  363.     public function getIsFeaturedTitle(): ?bool
  364.     {
  365.         return $this->isFeaturedTitle;
  366.     }
  367.     public function setIsFeaturedTitle(bool $isFeaturedTitle): self
  368.     {
  369.         $this->isFeaturedTitle $isFeaturedTitle;
  370.         return $this;
  371.     }
  372.     public function getImagePreviewMedia(): ?Media
  373.     {
  374.         return $this->imagePreviewMedia;
  375.     }
  376.     public function setImagePreviewMedia(?Media $imagePreviewMedia): self
  377.     {
  378.         $this->imagePreviewMedia $imagePreviewMedia;
  379.         return $this;
  380.     }
  381.     public function getFeaturingImageMedia(): ?Media
  382.     {
  383.         return $this->featuringImageMedia;
  384.     }
  385.     public function setFeaturingImageMedia(?Media $featuringImageMedia): self
  386.     {
  387.         $this->featuringImageMedia $featuringImageMedia;
  388.         return $this;
  389.     }
  390.     public function getIsPublic(): ?bool
  391.     {
  392.         return $this->isPublic;
  393.     }
  394.     public function setIsPublic(bool $isPublic): self
  395.     {
  396.         $this->isPublic $isPublic;
  397.         return $this;
  398.     }
  399.     public function getPosition(): ?int
  400.     {
  401.         return $this->position;
  402.     }
  403.     public function setPosition(int $position): self
  404.     {
  405.         $this->position $position;
  406.         return $this;
  407.     }
  408.     public function getIsPrivate(): bool
  409.     {
  410.         return !$this->isPublic;
  411.     }
  412.     public function getQrCode(): ?string
  413.     {
  414.         return $this->qrCode;
  415.     }
  416.     public function setQrCode(string $qrCode): self
  417.     {
  418.         $this->qrCode $qrCode;
  419.         return $this;
  420.     }
  421.     public function getQrCodeRouteName(): string
  422.     {
  423.         return 'podcast';
  424.     }
  425.     public function getQrCodeRouteParams(): array
  426.     {
  427.         return [
  428.             'slug' => $this->getSlug(),
  429.         ];
  430.     }
  431.     public function getMedia(): ?Media
  432.     {
  433.         return $this->media;
  434.     }
  435.     public function setMedia(?Media $media): self
  436.     {
  437.         $this->media $media;
  438.         return $this;
  439.     }
  440.     public function getPreviewVideo(): ?Media
  441.     {
  442.         return $this->previewVideo;
  443.     }
  444.     public function setPreviewVideo(?Media $previewVideo): self
  445.     {
  446.         $this->previewVideo $previewVideo;
  447.         return $this;
  448.     }
  449.     /**
  450.      * @return Collection|BlogPostLike[]
  451.      */
  452.     public function getLikes(): Collection
  453.     {
  454.         return $this->likes;
  455.     }
  456.     public function getLikeCount(): int
  457.     {
  458.         return $this->likes->count();
  459.     }
  460.     public function isLikedBy(?User $user): bool
  461.     {
  462.         return $this->likes->exists(function (int $index) use ($user) {
  463.             $like $this->likes->get($index);
  464.             return $user && $like->getUser() === $user;
  465.         });
  466.     }
  467.     public function addLike(BlogPostLike $like): self
  468.     {
  469.         if (!$this->likes->contains($like)) {
  470.             $this->likes[] = $like;
  471.             $like->setBlogPost($this);
  472.         }
  473.         return $this;
  474.     }
  475.     public function removeLike(BlogPostLike $like): self
  476.     {
  477.         if ($this->likes->removeElement($like)) {
  478.             // set the owning side to null (unless already changed)
  479.             if ($like->getBlogPost() === $this) {
  480.                 $like->setBlogPost(null);
  481.             }
  482.         }
  483.         return $this;
  484.     }
  485.     /**
  486.      * @return \DateTimeInterface|null
  487.      */
  488.     public function getNotificationSentAt(): ?\DateTimeInterface
  489.     {
  490.         return $this->notificationSentAt;
  491.     }
  492.     public function setNotificationSentAt(?\DateTimeInterface $notificationSentAt): self
  493.     {
  494.         $this->notificationSentAt $notificationSentAt;
  495.         return $this;
  496.     }
  497.     public function getNotification(): ?BlogPostNotification
  498.     {
  499.         return $this->notification;
  500.     }
  501.     public function setNotification(?BlogPostNotification $notification): self
  502.     {
  503.         $this->notification $notification;
  504.         return $this;
  505.     }
  506.     public function getIsNotify(): ?bool
  507.     {
  508.         return $this->isNotify;
  509.     }
  510.     public function setIsNotify(bool $isNotify): self
  511.     {
  512.         $this->isNotify $isNotify;
  513.         return $this;
  514.     }
  515.     public function getIsScheduled(): ?bool
  516.     {
  517.         return $this->isScheduled;
  518.     }
  519.     public function setIsScheduled(bool $isScheduled): self
  520.     {
  521.         $this->isScheduled $isScheduled;
  522.         return $this;
  523.     }
  524.     /**
  525.      * @return Collection<int, BlogPostHistoryUpdate>
  526.      */
  527.     public function getBlogPostHistoryUpdates(): Collection
  528.     {
  529.         return $this->blogPostHistoryUpdates;
  530.     }
  531.     public function addBlogPostHistoryUpdate(BlogPostHistoryUpdate $blogPostHistoryUpdate): self
  532.     {
  533.         if (!$this->blogPostHistoryUpdates->contains($blogPostHistoryUpdate)) {
  534.             $this->blogPostHistoryUpdates[] = $blogPostHistoryUpdate;
  535.             $blogPostHistoryUpdate->setBlogPost($this);
  536.         }
  537.         return $this;
  538.     }
  539.     public function removeBlogPostHistoryUpdate(BlogPostHistoryUpdate $blogPostHistoryUpdate): self
  540.     {
  541.         if ($this->blogPostHistoryUpdates->removeElement($blogPostHistoryUpdate)) {
  542.             // set the owning side to null (unless already changed)
  543.             if ($blogPostHistoryUpdate->getBlogPost() === $this) {
  544.                 $blogPostHistoryUpdate->setBlogPost(null);
  545.             }
  546.         }
  547.         return $this;
  548.     }
  549.     public function getPreference(): ?Preference
  550.     {
  551.         return $this->preference;
  552.     }
  553.     public function setPreference(?Preference $preference): self
  554.     {
  555.         $this->preference $preference;
  556.         return $this;
  557.     }
  558.     /**
  559.      * @return Collection<int, Roles>
  560.      */
  561.     public function getRoles(): Collection
  562.     {
  563.         return $this->roles;
  564.     }
  565.     public function addRole(Roles $role): self
  566.     {
  567.         if (!$this->roles->contains($role)) {
  568.             $this->roles[] = $role;
  569.         }
  570.         return $this;
  571.     }
  572.     public function setRoles(Collection $roles): self
  573.     {
  574.         $this->roles == $roles;
  575.         return $this;
  576.     }
  577.     public function removeRole(Roles $role): self
  578.     {
  579.         $this->roles->removeElement($role);
  580.         return $this;
  581.     }
  582.     public function convertRoleToArray()
  583.     {
  584.         $rolesArray = [];
  585.         foreach ($this->roles as $role) {
  586.             $rolesArray[] = $role->getCode();
  587.         }
  588.         return $rolesArray;
  589.     }
  590.     public function getActivationDate(): ?\DateTimeInterface
  591.     {
  592.         return $this->activation_date;
  593.     }
  594.     public function setActivationDate(?\DateTimeInterface $activation_date): self
  595.     {
  596.         $this->activation_date $activation_date;
  597.         return $this;
  598.     }
  599.     public function getDesactivationDate(): ?\DateTimeInterface
  600.     {
  601.         return $this->desactivation_date;
  602.     }
  603.     public function setDesactivationDate(?\DateTimeInterface $desactivation_date): self
  604.     {
  605.         $this->desactivation_date $desactivation_date;
  606.         return $this;
  607.     }
  608.     /**
  609.      * @return Collection<int, BlogPostGallery>
  610.      */
  611.     public function getGalleries(): Collection
  612.     {
  613.         return $this->galleries;
  614.     }
  615.     public function addGallery(BlogPostGallery $gallery): self
  616.     {
  617.         if (!$this->galleries->contains($gallery)) {
  618.             $this->galleries[] = $gallery;
  619.             $gallery->setBlogPost($this);
  620.         }
  621.         return $this;
  622.     }
  623.     public function removeGallery(BlogPostGallery $gallery): self
  624.     {
  625.         if ($this->galleries->removeElement($gallery)) {
  626.             // set the owning side to null (unless already changed)
  627.             if ($gallery->getBlogPost() === $this) {
  628.                 $gallery->setBlogPost(null);
  629.             }
  630.         }
  631.         return $this;
  632.     }
  633.     public function getAuthor(): ?User
  634.     {
  635.         return $this->author;
  636.     }
  637.     public function setAuthor(?User $author): self
  638.     {
  639.         $this->author $author;
  640.         return $this;
  641.     }
  642.     public function isHasAllCriteria1(): ?bool
  643.     {
  644.         return $this->hasAllCriteria1;
  645.     }
  646.     public function setHasAllCriteria1(?bool $hasAllCriteria1): self
  647.     {
  648.         $this->hasAllCriteria1 $hasAllCriteria1;
  649.         return $this;
  650.     }
  651.     /**
  652.      * @return Collection<int, Criteria1Item>
  653.      */
  654.     public function getCriteria1Items(): Collection
  655.     {
  656.         return $this->criteria1Items;
  657.     }
  658.     public function addCriteria1Item(Criteria1Item $criteria1Item): self
  659.     {
  660.         if (!$this->criteria1Items->contains($criteria1Item)) {
  661.             $this->criteria1Items[] = $criteria1Item;
  662.         }
  663.         return $this;
  664.     }
  665.     public function removeCriteria1Item(Criteria1Item $criteria1Item): self
  666.     {
  667.         $this->criteria1Items->removeElement($criteria1Item);
  668.         return $this;
  669.     }
  670.     public function isHasAllCriteria2(): ?bool
  671.     {
  672.         return $this->hasAllCriteria2;
  673.     }
  674.     public function setHasAllCriteria2(?bool $hasAllCriteria2): self
  675.     {
  676.         $this->hasAllCriteria2 $hasAllCriteria2;
  677.         return $this;
  678.     }
  679.     /**
  680.      * @return Collection<int, Criteria2Item>
  681.      */
  682.     public function getCriteria2Items(): Collection
  683.     {
  684.         return $this->criteria2Items;
  685.     }
  686.     public function addCriteria2Item(Criteria2Item $criteria2Item): self
  687.     {
  688.         if (!$this->criteria2Items->contains($criteria2Item)) {
  689.             $this->criteria2Items[] = $criteria2Item;
  690.         }
  691.         return $this;
  692.     }
  693.     public function removeCriteria2Item(Criteria2Item $criteria2Item): self
  694.     {
  695.         $this->criteria2Items->removeElement($criteria2Item);
  696.         return $this;
  697.     }
  698.     public function isHasAllCriteria3(): ?bool
  699.     {
  700.         return $this->hasAllCriteria3;
  701.     }
  702.     public function setHasAllCriteria3(?bool $hasAllCriteria3): self
  703.     {
  704.         $this->hasAllCriteria3 $hasAllCriteria3;
  705.         return $this;
  706.     }
  707.     /**
  708.      * @return Collection<int, Criteria3Item>
  709.      */
  710.     public function getCriteria3Items(): Collection
  711.     {
  712.         return $this->criteria3Items;
  713.     }
  714.     public function addCriteria3Item(Criteria3Item $criteria3Item): self
  715.     {
  716.         if (!$this->criteria3Items->contains($criteria3Item)) {
  717.             $this->criteria3Items[] = $criteria3Item;
  718.         }
  719.         return $this;
  720.     }
  721.     public function removeCriteria3Item(Criteria3Item $criteria3Item): self
  722.     {
  723.         $this->criteria3Items->removeElement($criteria3Item);
  724.         return $this;
  725.     }
  726.     public function getScoringQuiz(): ?ScoringQuiz
  727.     {
  728.         return $this->scoringQuiz;
  729.     }
  730.     public function setScoringQuiz(?ScoringQuiz $scoringQuiz): ?self
  731.     {
  732.         $this->scoringQuiz $scoringQuiz;
  733.     }
  734.     public function setBlogPost(ScoringQuiz $scoringQuiz): self
  735.     {
  736.         // set the owning side of the relation if necessary
  737.         if ($scoringQuiz->getBlogPost() !== $this) {
  738.             $scoringQuiz->setBlogPost($this);
  739.         }
  740.         $this->scoringQuiz $scoringQuiz;
  741.         return $this;
  742.     }
  743.     public function getIdentityForm(): ?IdentityForm
  744.     {
  745.         return $this->identityForm;
  746.     }
  747.     public function setIdentityForm(?IdentityForm $identityForm): self
  748.     {
  749.         if ($identityForm && $identityForm->getBlogPost() !== $this) {
  750.             $identityForm->setBlogPost($this);
  751.         }
  752.     
  753.         $this->identityForm $identityForm;
  754.         return $this;
  755.     }
  756.     public function getIdentityField1(): ?string
  757.     {
  758.         return $this->identityField1;
  759.     }
  760.     public function setIdentityField1(?string $identityField1): self
  761.     {
  762.         $this->identityField1 $identityField1;
  763.         return $this;
  764.     }
  765.     public function getIdentityField2(): ?string
  766.     {
  767.         return $this->identityField2;
  768.     }
  769.     public function setIdentityField2(?string $identityField2): self
  770.     {
  771.         $this->identityField2 $identityField2;
  772.         return $this;
  773.     }
  774.     public function getIdentityField3(): ?string
  775.     {
  776.         return $this->identityField3;
  777.     }
  778.     public function setIdentityField3(?string $identityField3): self
  779.     {
  780.         $this->identityField3 $identityField3;
  781.         return $this;
  782.     }
  783.     public function getIdentityField4(): ?string
  784.     {
  785.         return $this->identityField4;
  786.     }
  787.     public function setIdentityField4(?string $identityField4): self
  788.     {
  789.         $this->identityField4 $identityField4;
  790.         return $this;
  791.     }
  792.     public function getIdentityField5(): ?string
  793.     {
  794.         return $this->identityField5;
  795.     }
  796.     public function setIdentityField5(?string $identityField5): self
  797.     {
  798.         $this->identityField5 $identityField5;
  799.         return $this;
  800.     }
  801.     public function getIdentityField6(): ?string
  802.     {
  803.         return $this->identityField6;
  804.     }
  805.     public function setIdentityField6(?string $identityField6): self
  806.     {
  807.         $this->identityField6 $identityField6;
  808.         return $this;
  809.     }
  810.     public function getIdentityField7(): ?string
  811.     {
  812.         return $this->identityField7;
  813.     }
  814.     public function setIdentityField7(?string $identityField7): self
  815.     {
  816.         $this->identityField7 $identityField7;
  817.         return $this;
  818.     }
  819.     public function getIdentityTextarea(): ?string
  820.     {
  821.         return $this->identityTextarea;
  822.     }
  823.     public function setIdentityTextarea(?string $identityTextarea): self
  824.     {
  825.         $this->identityTextarea $identityTextarea;
  826.         return $this;
  827.     }
  828.     public function setIdentityMediaFile(?File $file null): void
  829.     {
  830.         $this->identityMediaFile $file;
  831.         
  832.         if (null !== $file) {
  833.             $this->updatedAt = new \DateTimeImmutable();
  834.         }
  835.     }
  836.     public function getIdentityMediaFile(): ?File
  837.     {
  838.         return $this->identityMediaFile;
  839.     }
  840.     public function setIdentityMedia(?String $media): self
  841.     {
  842.         $this->identityMedia $media;
  843.         return $this;
  844.     }
  845.     public function getIdentityMedia(): ?string
  846.     {
  847.         return $this->identityMedia;
  848.     }
  849.     public function getUserIdentityForms(): Collection
  850.     {
  851.         return $this->userIdentityForms;
  852.     }
  853.     
  854.     public function getUserIdentityForm(User $user): ?UserIdentityForm
  855.     {
  856.         foreach ($this->userIdentityForms as $form) {
  857.             if ($form->getUser() === $user) {
  858.                 return $form;
  859.             }
  860.         }
  861.         return null;
  862.     }
  863.     
  864.     public function addUserIdentityForm(UserIdentityForm $userIdentityForm): self
  865.     {
  866.         if (!$this->userIdentityForms->contains($userIdentityForm)) {
  867.             $this->userIdentityForms[] = $userIdentityForm;
  868.             $userIdentityForm->setBlogPost($this);
  869.         }
  870.         return $this;
  871.     }
  872.     
  873.     public function removeUserIdentityForm(UserIdentityForm $userIdentityForm): self
  874.     {
  875.         if ($this->userIdentityForms->removeElement($userIdentityForm)) {
  876.             if ($userIdentityForm->getBlogPost() === $this) {
  877.                 $userIdentityForm->setBlogPost(null);
  878.             }
  879.         }
  880.         return $this;
  881.     }
  882. }