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