src/Entity/Newsfeed.php line 79

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Annotation\EsUploadable;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Annotation\EsElasticIndex;
  6. use App\Repository\NewsfeedRepository;
  7. use ApiPlatform\Core\Annotation\ApiFilter;
  8. use App\Entity\Traits\TimestampableEntity;
  9. use Doctrine\Common\Collections\Collection;
  10. use ApiPlatform\Core\Annotation\ApiProperty;
  11. use ApiPlatform\Core\Annotation\ApiResource;
  12. use App\Entity\Interfaces\OwnerMappedInterface;
  13. use App\Entity\Interfaces\UploadMappedInterface;
  14. use Doctrine\Common\Collections\ArrayCollection;
  15. use App\Entity\Interfaces\ElasticMappedInterface;
  16. use App\Entity\Interfaces\ContainerMappedInterface;
  17. use App\Entity\Interfaces\TotalLikeMappedInterface;
  18. use Symfony\Component\Serializer\Annotation\Groups;
  19. use Symfony\Component\Validator\Constraints as Assert;
  20. use Symfony\Component\Serializer\Annotation\SerializedName;
  21. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  22. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  23. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  24. /**
  25.  * @ApiResource(
  26.  *      attributes={"security"="is_granted('IS_AUTHENTICATED_FULLY')"},
  27.  *      normalizationContext={"groups"={"Newsfeed:Read", "TZ:Read", "Container:Storage"}, "skip_null_values"=false},
  28.  *      denormalizationContext={"groups"={"Newsfeed:Write"}},
  29.  *      collectionOperations={
  30.  *          "get"={
  31.  *              "method"="GET",
  32.  *              "normalization_context"={"groups"={"Newsfeed:Read", "TZ:Read", "Container:Storage"}, "skip_null_values"=false},
  33.  *          },
  34.  *          "get_user_feed"={
  35.  *              "path"="/newsfeeds/get-user-feed",
  36.  *              "method"="GET",
  37.  *              "normalization_context"={"groups"={"Newsfeed:Read", "TZ:Read", "Container:Storage"}, "skip_null_values"=false},
  38.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  39.  *          },
  40.  *          "get_user_saved"={
  41.  *              "path"="/newsfeeds/get-user-saved",
  42.  *              "method"="GET",
  43.  *              "normalization_context"={"groups"={"Newsfeed:Read", "TZ:Read", "Container:Storage"}, "skip_null_values"=false},
  44.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  45.  *          },
  46.  *          "post"={"security"="is_granted('ROLE_USER')"}
  47.  *      },
  48.  *      itemOperations={
  49.  *          "get"={
  50.  *              "normalization_context"={"groups"={"Newsfeed:Read", "TZ:Read", "Container:Storage"}, "skip_null_values"=false},
  51.  *              "security"="is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_OPR', object)"
  52.  *          },
  53.  *          "get_dicom"={
  54.  *              "path"="/newsfeeds/{id}/get-dicom",
  55.  *              "method"="GET",
  56.  *              "normalization_context"={"groups"={"Newsfeed:Read", "Newsfeed:Read-Dicom", "TZ:Read", "Container:Storage"}, "skip_null_values"=false},
  57.  *              "security"="is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_OPR', object)"
  58.  *          },
  59.  *          "put"={"security"="is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_OPR', object)"},
  60.  *          "patch"={"security"="is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_OPR', object)"},
  61.  *          "patch_like_toggle"={
  62.  *              "route_name"="api_newsfeeds_like_toggle_collection",
  63.  *              "method"="PATCH",
  64.  *              "security"="is_granted('ROLE_USER', object)",
  65.  *              "denormalization_context"={"groups"={"Newsfeed:Like-Toggle"}}
  66.  *          },
  67.  *          "delete"={"security"="is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_OPR', object)"}
  68.  *     }
  69.  * )
  70.  * @ApiFilter(SearchFilter::class, properties={"postText": "partial", "user.id": "exact", "container.id": "exact", "postType": "exact", "typeId": "exact", "newsfeedCategory.id": "exact", "newsfeedTags.id": "exact", "userGroups.id": "exact", "company.id": "exact"})
  71.  * @ApiFilter(BooleanFilter::class, properties={"isPublished"})
  72.  * @ApiFilter(OrderFilter::class, properties={"id": "DESC", "updatedAt", "createdAt", "commentedAt", "totalLikes"})
  73.  * @ORM\Entity(repositoryClass=NewsfeedRepository::class)
  74.  * @EsElasticIndex("Newsfeed:EL")
  75.  */
  76. class Newsfeed implements ContainerMappedInterfaceOwnerMappedInterfaceUploadMappedInterfaceTotalLikeMappedInterfaceElasticMappedInterface
  77. {
  78.     /**
  79.      * Hook timestampable behavior
  80.      * updates createdAt, updatedAt fields
  81.      */
  82.     use TimestampableEntity;
  83.     /**
  84.      * @ORM\Id
  85.      * @ORM\GeneratedValue
  86.      * @ORM\Column(type="integer")
  87.      * @Groups({"Newsfeed:EL", "Newsfeed:Read"})
  88.      */
  89.     private $id;
  90.     /**
  91.      * @ORM\Column(type="text", nullable=true)
  92.      * @Assert\Regex(
  93.      *     pattern="/(\b)(on\S+)(\s*)=|javascript|(<\s*)(\/*)script/mi",
  94.      *     match=false,
  95.      *     message="validation.newsfeed:message.invalidContent"
  96.      * )
  97.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  98.      */
  99.     private $postText;
  100.     /**
  101.      * @ORM\ManyToOne(targetEntity=User::class)
  102.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  103.      * @Groups({"Newsfeed:EL", "Newsfeed:Read"})
  104.      */
  105.     private $user;
  106.     /**
  107.      * @ORM\ManyToOne(targetEntity=Container::class)
  108.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  109.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  110.      */
  111.     private $container;
  112.     /**
  113.      * @ORM\Column(type="boolean")
  114.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  115.      */
  116.     private $isPublished;
  117.     /**
  118.      * @ORM\OneToMany(targetEntity=NewsfeedComment::class, mappedBy="newsfeed", orphanRemoval=true)
  119.      */
  120.     private $newsfeedComments;
  121.     /**
  122.      * @ORM\Column(type="array", nullable=true)
  123.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  124.      * @EsUploadable()
  125.      */
  126.     protected $mediaFileNames = [];
  127.     /**
  128.      * @ORM\OneToMany(targetEntity=CommonComment::class, mappedBy="newsfeed")
  129.      */
  130.     private $commonComments;
  131.     /**
  132.      * @ORM\Column(type="string", length=32)
  133.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  134.      * @ApiProperty(
  135.      *     attributes={
  136.      *         "openapi_context"={
  137.      *             "type"="string",
  138.      *             "enum"={self::POSTTYPE_TEXT, self::POSTTYPE_COMPANY, self::POSTTYPE_SESSION, self::POSTTYPE_ELTASK, self::POSTTYPE_ELEXAM}
  139.      *         }
  140.      *     }
  141.      * )
  142.      *
  143.      * @Assert\NotBlank(message="validation.newsfeed:postType.notBlank")
  144.      * @Assert\Choice({self::POSTTYPE_TEXT, self::POSTTYPE_COMPANY, self::POSTTYPE_SESSION, self::POSTTYPE_ELTASK, self::POSTTYPE_ELEXAM})
  145.      */
  146.     private $postType self::POSTTYPE_TEXT;
  147.     public const POSTTYPE_TEXT "TEXT";
  148.     public const POSTTYPE_COMPANY "COMPANY";
  149.     public const POSTTYPE_SESSION CommonComment::SOURCE_SESSION;
  150.     public const POSTTYPE_ELTASK CommonComment::SOURCE_ELTASK;
  151.     public const POSTTYPE_ELEXAM CommonComment::SOURCE_ELEXAM;
  152.     public const POSTTYPE_DOCFILEBLOCK CommonComment::SOURCE_DOCFILEBLOCK;
  153.     public const POSTTYPE_VIDEOGALLERY CommonComment::SOURCE_VIDEOGALLERY;
  154.     public const POSTTYPE_INFOPAGE CommonComment::SOURCE_INFOPAGE;
  155.     /**
  156.      * @ORM\Column(type="integer", nullable=true)
  157.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  158.      */
  159.     private $typeId;
  160.     /**
  161.      * @ORM\Column(type="json", nullable=true)
  162.      * @Groups({"Newsfeed:Read"})
  163.      */
  164.     private $initialComments = [];
  165.     /**
  166.      * @ORM\Column(type="json", nullable=true)
  167.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  168.      */
  169.     private $postMetadata = [];
  170.     /**
  171.      * @ORM\Column(type="integer", nullable=true)
  172.      * @Groups({"Newsfeed:EL", "Newsfeed:Read"})
  173.      */
  174.     private $totalLikes;
  175.     /**
  176.      * @ORM\Column(type="array", nullable=true)
  177.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  178.      */
  179.     private $assignUsers = [];
  180.     /**
  181.      * @ORM\Column(type="string", length=32, nullable=true)
  182.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  183.      */
  184.     private $mediaFileType;
  185.     public const MEDIAFILETYPE_IMAGE "IMAGE";
  186.     public const MEDIAFILETYPE_VIDEO "VIDEO";
  187.     public const MEDIAFILETYPE_DOCUMENT "DOCUMENT";
  188.     public const MEDIAFILETYPE_DICOM "DICOM";
  189.     public const MEDIAFILETYPE_VOTE "VOTE";
  190.     /**
  191.      * @ORM\ManyToOne(targetEntity=CommonCategory::class)
  192.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  193.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  194.      */
  195.     private $newsfeedCategory;
  196.     /**
  197.      * @ORM\ManyToMany(targetEntity=NewsfeedTag::class, mappedBy="newsfeeds", cascade={"persist"})
  198.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  199.      */
  200.     private $newsfeedTags;
  201.     /**
  202.      * @ORM\ManyToMany(targetEntity=UserGroup::class, inversedBy="newsfeeds")
  203.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  204.      */
  205.     private $userGroups;
  206.     /**
  207.      * @ORM\Column(type="string", length=32, nullable=true)
  208.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  209.      * @ApiProperty(
  210.      *     attributes={
  211.      *         "openapi_context"={
  212.      *             "type"="string",
  213.      *             "enum"={self::POSTSUBTYPE_TEXT, self::POSTSUBTYPE_CONFERENCE, self::POSTSUBTYPE_SESSION, self::POSTSUBTYPE_ELCOURSE, self::POSTSUBTYPE_DOCUMENT, self::POSTSUBTYPE_VIDEOGALLERY}
  214.      *         }
  215.      *     }
  216.      * )
  217.      *
  218.      * @Assert\Choice({self::POSTSUBTYPE_TEXT, self::POSTSUBTYPE_CONFERENCE, self::POSTSUBTYPE_SESSION, self::POSTSUBTYPE_ELCOURSE, self::POSTSUBTYPE_DOCUMENT, self::POSTSUBTYPE_VIDEOGALLERY})
  219.      */
  220.     private $postSubType self::POSTSUBTYPE_TEXT;
  221.     public const POSTSUBTYPE_TEXT "TEXT";
  222.     public const POSTSUBTYPE_CONFERENCE "CONFERENCE";
  223.     public const POSTSUBTYPE_SESSION "SESSION";
  224.     public const POSTSUBTYPE_ELCOURSE "COURSE";
  225.     public const POSTSUBTYPE_DOCUMENT "DOCUMENT";
  226.     public const POSTSUBTYPE_VIDEOGALLERY "VIDEOGALLERY";
  227.     public const POSTSUBTYPE_INFOPAGE "INFOPAGE";
  228.     /**
  229.      * @ORM\Column(type="json", nullable=true)
  230.      * @Groups({"Newsfeed:Read-Dicom", "Newsfeed:Write"})
  231.      */
  232.     private $dicomFileInfo = [];
  233.     /**
  234.      * @ORM\Column(type="string", length=255, nullable=true)
  235.      * @Groups({"Newsfeed:EL", "Newsfeed:Read", "Newsfeed:Write"})
  236.      */
  237.     private $title;
  238.     /**
  239.      * @ORM\Column(type="datetime", nullable=true)
  240.      * @Groups({"Newsfeed:EL", "Newsfeed:Read"})
  241.      */
  242.     private $voteExpiry;
  243.     /**
  244.      * @ORM\Column(type="json", nullable=true)
  245.      * @Groups({"Newsfeed:EL", "Newsfeed:Read"})
  246.      */
  247.     private $voteResult = [];
  248.     /**
  249.      * @ORM\OneToMany(targetEntity=NewsfeedVoteAnswer::class, mappedBy="newsfeed")
  250.      */
  251.     private $newsfeedVoteAnswers;
  252.     /**
  253.      * @ORM\OneToMany(targetEntity=NewsfeedSaved::class, mappedBy="newsfeed")
  254.      */
  255.     private $newsfeedSaved;
  256.     /**
  257.      * @ORM\Column(type="datetime_immutable", nullable=true)
  258.      */
  259.     private $commentedAt;
  260.     /**
  261.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="newsfeeds")
  262.      * @Groups({"Newsfeed:Read", "Newsfeed:Write"})
  263.      */
  264.     private $company;
  265.     /**
  266.      * @ORM\Column(type="boolean", nullable=true)
  267.      * @Groups({"Newsfeed:Read"})
  268.      */
  269.     private $isContainerFeedSent;
  270.     public function __construct()
  271.     {
  272.         $this->newsfeedComments = new ArrayCollection();
  273.         $this->commonComments = new ArrayCollection();
  274.         $this->newsfeedTags = new ArrayCollection();
  275.         $this->userGroups = new ArrayCollection();
  276.         $this->newsfeedVoteAnswers = new ArrayCollection();
  277.         $this->newsfeedSaved = new ArrayCollection();
  278.     }
  279.     public function getId(): ?int
  280.     {
  281.         return $this->id;
  282.     }
  283.     public function getPostText(): ?string
  284.     {
  285.         return $this->postText;
  286.     }
  287.     public function setPostText(string $postText): self
  288.     {
  289.         $this->postText $postText;
  290.         return $this;
  291.     }
  292.     public function getUser(): ?User
  293.     {
  294.         return $this->user;
  295.     }
  296.     public function setUser(?User $user): self
  297.     {
  298.         $this->user $user;
  299.         return $this;
  300.     }
  301.     public function getContainer(): ?Container
  302.     {
  303.         return $this->container;
  304.     }
  305.     public function setContainer(?Container $container): self
  306.     {
  307.         $this->container $container;
  308.         return $this;
  309.     }
  310.     public function getIsPublished(): ?bool
  311.     {
  312.         return $this->isPublished;
  313.     }
  314.     public function setIsPublished(bool $isPublished): self
  315.     {
  316.         $this->isPublished $isPublished;
  317.         return $this;
  318.     }
  319.     /**
  320.      * @return Collection|NewsfeedComment[]
  321.      */
  322.     public function getNewsfeedComments()
  323.     {
  324.         return $this->newsfeedComments;
  325.     }
  326.     public function addNewsfeedComment(NewsfeedComment $newsfeedComment): self
  327.     {
  328.         if (!$this->newsfeedComments->contains($newsfeedComment)) {
  329.             $this->newsfeedComments[] = $newsfeedComment;
  330.             $newsfeedComment->setNewsfeed($this);
  331.         }
  332.         return $this;
  333.     }
  334.     public function removeNewsfeedComment(NewsfeedComment $newsfeedComment): self
  335.     {
  336.         if ($this->newsfeedComments->removeElement($newsfeedComment)) {
  337.             // set the owning side to null (unless already changed)
  338.             if ($newsfeedComment->getNewsfeed() === $this) {
  339.                 $newsfeedComment->setNewsfeed(null);
  340.             }
  341.         }
  342.         return $this;
  343.     }
  344.     public function getMediaFileNames(): ?array
  345.     {
  346.         return $this->mediaFileNames;
  347.     }
  348.     public function setMediaFileNames(?array $mediaFileNames): self
  349.     {
  350.         $this->mediaFileNames $mediaFileNames;
  351.         return $this;
  352.     }
  353.     /**
  354.      * @return Collection|CommonComment[]
  355.      */
  356.     public function getCommonComments(): Collection
  357.     {
  358.         return $this->commonComments;
  359.     }
  360.     public function addCommonComment(CommonComment $commonComment): self
  361.     {
  362.         if (!$this->commonComments->contains($commonComment)) {
  363.             $this->commonComments[] = $commonComment;
  364.             $commonComment->setNewsfeed($this);
  365.         }
  366.         return $this;
  367.     }
  368.     public function removeCommonComment(CommonComment $commonComment): self
  369.     {
  370.         if ($this->commonComments->removeElement($commonComment)) {
  371.             // set the owning side to null (unless already changed)
  372.             if ($commonComment->getNewsfeed() === $this) {
  373.                 $commonComment->setNewsfeed(null);
  374.             }
  375.         }
  376.         return $this;
  377.     }
  378.     public function getPostType(): ?string
  379.     {
  380.         return $this->postType;
  381.     }
  382.     public function setPostType(string $postType): self
  383.     {
  384.         $this->postType $postType;
  385.         return $this;
  386.     }
  387.     public function getTypeId(): ?int
  388.     {
  389.         return $this->typeId;
  390.     }
  391.     public function setTypeId(?int $typeId): self
  392.     {
  393.         $this->typeId $typeId;
  394.         return $this;
  395.     }
  396.     public function getInitialComments(): ?array
  397.     {
  398.         return $this->initialComments;
  399.     }
  400.     public function setInitialComments(?array $initialComments): self
  401.     {
  402.         $this->initialComments $initialComments;
  403.         return $this;
  404.     }
  405.     public function getPostMetadata(): ?array
  406.     {
  407.         return $this->postMetadata;
  408.     }
  409.     public function setPostMetadata(?array $postMetadata): self
  410.     {
  411.         $this->postMetadata $postMetadata;
  412.         return $this;
  413.     }
  414.     public function getIsPostEnable()
  415.     {
  416.         return true;
  417.     }
  418.     public function getTotalLikes(): ?int
  419.     {
  420.         return $this->totalLikes;
  421.     }
  422.     public function setTotalLikes(?int $totalLikes)
  423.     {
  424.         $this->totalLikes $totalLikes;
  425.         return $this;
  426.     }
  427.     public function getAssignUsers(): ?array
  428.     {
  429.         return $this->assignUsers;
  430.     }
  431.     public function setAssignUsers(?array $assignUsers): self
  432.     {
  433.         $this->assignUsers $assignUsers;
  434.         return $this;
  435.     }
  436.     public function getMediaFileType(): ?string
  437.     {
  438.         return $this->mediaFileType;
  439.     }
  440.     public function setMediaFileType(?string $mediaFileType): self
  441.     {
  442.         $this->mediaFileType $mediaFileType;
  443.         return $this;
  444.     }
  445.     public function getNewsfeedCategory(): ?CommonCategory
  446.     {
  447.         return $this->newsfeedCategory;
  448.     }
  449.     public function setNewsfeedCategory(?CommonCategory $newsfeedCategory): self
  450.     {
  451.         $this->newsfeedCategory $newsfeedCategory;
  452.         return $this;
  453.     }
  454.     /**
  455.      * @return Collection<int, NewsfeedTag>
  456.      */
  457.     public function getNewsfeedTags(): Collection
  458.     {
  459.         return $this->newsfeedTags;
  460.     }
  461.     /**
  462.      * @Groups({"Newsfeed:EL"})
  463.      * @SerializedName("tags")
  464.      */
  465.     public function getTagsArray()
  466.     {
  467.         $tags = [];
  468.         foreach ($this->newsfeedTags as $tag) {
  469.             $tags[] = $tag->getName();
  470.         }
  471.         return $tags;
  472.     }
  473.     public function addNewsfeedTag(NewsfeedTag $newsfeedTag): self
  474.     {
  475.         if (!$this->newsfeedTags->contains($newsfeedTag)) {
  476.             $this->newsfeedTags[] = $newsfeedTag;
  477.             $newsfeedTag->addNewsfeed($this);
  478.         }
  479.         return $this;
  480.     }
  481.     public function removeNewsfeedTag(NewsfeedTag $newsfeedTag): self
  482.     {
  483.         if ($this->newsfeedTags->removeElement($newsfeedTag)) {
  484.             $newsfeedTag->removeNewsfeed($this);
  485.         }
  486.         return $this;
  487.     }
  488.     /**
  489.      * @return Collection<int, UserGroup>
  490.      */
  491.     public function getUserGroups(): Collection
  492.     {
  493.         return $this->userGroups;
  494.     }
  495.     /**
  496.      * @Groups({"Newsfeed:EL"})
  497.      * @SerializedName("groups")
  498.      */
  499.     public function getUserGroupsArray()
  500.     {
  501.         $groups = [];
  502.         foreach ($this->userGroups as $group) {
  503.             if (!$group->getIsGenerated()) {
  504.                 $groups[] = $group->getId();
  505.             }
  506.         }
  507.         return $groups;
  508.     }
  509.     public function addUserGroup(UserGroup $userGroup): self
  510.     {
  511.         if (!$this->userGroups->contains($userGroup)) {
  512.             $this->userGroups[] = $userGroup;
  513.         }
  514.         return $this;
  515.     }
  516.     public function removeUserGroup(UserGroup $userGroup): self
  517.     {
  518.         $this->userGroups->removeElement($userGroup);
  519.         return $this;
  520.     }
  521.     public function setUserGroups($userGroups): self
  522.     {
  523.         $this->userGroups $userGroups;
  524.         return $this;
  525.     }
  526.     public function getPostSubType(): ?string
  527.     {
  528.         return $this->postSubType;
  529.     }
  530.     public function setPostSubType(?string $postSubType): self
  531.     {
  532.         $this->postSubType $postSubType;
  533.         return $this;
  534.     }
  535.     public function getPostSubTypeEntity(?string $postSubType null)
  536.     {
  537.         switch($this->postSubType ?? $postSubType) {
  538.             case self::POSTSUBTYPE_CONFERENCE:
  539.                 return Conference::class;
  540.             case self::POSTSUBTYPE_SESSION:
  541.                 return Session::class;
  542.             case self::POSTSUBTYPE_ELCOURSE:
  543.                 return ElCourse::class;
  544.             case self::POSTSUBTYPE_DOCUMENT:
  545.                 return DocFile::class;
  546.             case self::POSTSUBTYPE_VIDEOGALLERY:
  547.                 return VideoGallery::class;
  548.             case self::POSTSUBTYPE_INFOPAGE:
  549.                 return InfoPage::class;
  550.         }
  551.         return false;
  552.     }
  553.     public function getDicomFileInfo(): ?array
  554.     {
  555.         return $this->dicomFileInfo;
  556.     }
  557.     public function setDicomFileInfo(?array $dicomFileInfo): self
  558.     {
  559.         $this->dicomFileInfo $dicomFileInfo;
  560.         return $this;
  561.     }
  562.     public function getTitle(): ?string
  563.     {
  564.         return $this->title;
  565.     }
  566.     public function setTitle(?string $title): self
  567.     {
  568.         $this->title $title;
  569.         return $this;
  570.     }
  571.     public function getVoteExpiry(): ?\DateTimeInterface
  572.     {
  573.         return $this->voteExpiry;
  574.     }
  575.     public function setVoteExpiry(?\DateTimeInterface $voteExpiry): self
  576.     {
  577.         $this->voteExpiry $voteExpiry;
  578.         return $this;
  579.     }
  580.     public function getVoteResult(): ?array
  581.     {
  582.         return $this->voteResult;
  583.     }
  584.     public function setVoteResult(?array $voteResult): self
  585.     {
  586.         $this->voteResult $voteResult;
  587.         return $this;
  588.     }
  589.     /**
  590.      * @return Collection<int, NewsfeedVoteAnswer>
  591.      */
  592.     public function getNewsfeedVoteAnswers(): Collection
  593.     {
  594.         return $this->newsfeedVoteAnswers;
  595.     }
  596.     public function addNewsfeedVoteAnswer(NewsfeedVoteAnswer $newsfeedVoteAnswer): self
  597.     {
  598.         if (!$this->newsfeedVoteAnswers->contains($newsfeedVoteAnswer)) {
  599.             $this->newsfeedVoteAnswers[] = $newsfeedVoteAnswer;
  600.             $newsfeedVoteAnswer->setNewsfeed($this);
  601.         }
  602.         return $this;
  603.     }
  604.     public function removeNewsfeedVoteAnswer(NewsfeedVoteAnswer $newsfeedVoteAnswer): self
  605.     {
  606.         if ($this->newsfeedVoteAnswers->removeElement($newsfeedVoteAnswer)) {
  607.             // set the owning side to null (unless already changed)
  608.             if ($newsfeedVoteAnswer->getNewsfeed() === $this) {
  609.                 $newsfeedVoteAnswer->setNewsfeed(null);
  610.             }
  611.         }
  612.         return $this;
  613.     }
  614.     /**
  615.      * @return Collection<int, NewsfeedSaved>
  616.      */
  617.     public function getNewsfeedSaved(): Collection
  618.     {
  619.         return $this->newsfeedSaved;
  620.     }
  621.     public function addNewsfeedSaved(NewsfeedSaved $newsfeedSaved): self
  622.     {
  623.         if (!$this->newsfeedSaved->contains($newsfeedSaved)) {
  624.             $this->newsfeedSaved[] = $newsfeedSaved;
  625.             $newsfeedSaved->setNewsfeed($this);
  626.         }
  627.         return $this;
  628.     }
  629.     public function removeNewsfeedSaved(NewsfeedSaved $newsfeedSaved): self
  630.     {
  631.         if ($this->newsfeedSaved->removeElement($newsfeedSaved)) {
  632.             // set the owning side to null (unless already changed)
  633.             if ($newsfeedSaved->getNewsfeed() === $this) {
  634.                 $newsfeedSaved->setNewsfeed(null);
  635.             }
  636.         }
  637.         return $this;
  638.     }
  639.     public function getCommentedAt(): ?\DateTimeImmutable
  640.     {
  641.         return $this->commentedAt;
  642.     }
  643.     public function setCommentedAt(?\DateTimeImmutable $commentedAt): self
  644.     {
  645.         $this->commentedAt $commentedAt;
  646.         return $this;
  647.     }
  648.     /**
  649.      * @Groups({"Newsfeed:EL"})
  650.      */
  651.     public function getCntId()
  652.     {
  653.         return $this->container->getId();
  654.     }
  655.     /**
  656.      * @Groups({"Newsfeed:EL"})
  657.      */
  658.     public function getCategory()
  659.     {
  660.         return $this->getNewsfeedCategory();
  661.     }
  662.     public function getCompany(): ?Company
  663.     {
  664.         return $this->company;
  665.     }
  666.     public function setCompany(?Company $company): self
  667.     {
  668.         $this->company $company;
  669.         return $this;
  670.     }
  671.     public function getIsContainerFeedSent(): ?bool
  672.     {
  673.         return $this->isContainerFeedSent;
  674.     }
  675.     public function setIsContainerFeedSent(?bool $isContainerFeedSent): self
  676.     {
  677.         $this->isContainerFeedSent $isContainerFeedSent;
  678.         return $this;
  679.     }
  680. }