src/Entity/PostRecord.php line 16
<?phpnamespace App\Entity;use App\Repository\PostRecordRepository;use App\Traits\Timestamps;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PostRecordRepository::class)]#[ORM\InheritanceType("SINGLE_TABLE")]#[ORM\DiscriminatorColumn(name: "discr", type: "string", length: 3)]#[ORM\DiscriminatorMap(["PST"=> PostRecord::class,"STR"=> StoryRecord::class])]#[ORM\HasLifecycleCallbacks]class PostRecord{use Timestamps;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'postRecords',cascade: ['persist'])]#[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")]private ?RecordSocialMedia $record = null;#[ORM\Column(length: 255, nullable: true)]private ?string $type = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $date = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $message = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $link = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $imageLink = null;/*** @var int|null* page_posts_reactions on facebook*/#[ORM\Column(nullable: true)]private ?int $likeCount = null;#[ORM\Column(nullable: true)]private ?int $commentCount = null;#[ORM\Column(nullable: true)]private ?int $shareCount = null;#[ORM\Column(nullable: true)]private ?int $engagment = null;#[ORM\Column(nullable: true)]private ?int $reach = null;#[ORM\Column(length: 255, nullable: true)]private ?string $reference = null;#[ORM\Column(nullable: true)]private ?int $twitterQuotes = null;//reach#[ORM\Column(nullable: true)]private ?int $pagePostsImpressionsOrganicUnique = null;//reach#[ORM\Column(nullable: true)]private ?int $pagePostsImpressionsPaidUnique = null;//impression (facebook , twitter)#[ORM\Column(nullable: true)]private ?int $pagePostsImpressionsOrganic = null;//impression#[ORM\Column(nullable: true)]private ?int $pagePostImpressionsPaid = null;#[ORM\Column(nullable: true)]private ?int $facebookVideoViewsTotal = null;#[ORM\Column(nullable: true)]private ?int $facebookVideoViewscompleteTotal = null;#[ORM\Column(nullable: true)]private ?int $facebookVideoViewTime = null;#[ORM\Column(nullable: true)]private ?int $facebookReelViewsTotal = null;#[ORM\Column(nullable: true)]private ?int $facebookReelViewsCompleteTotal = null;/*** @var int|null* page_link_video_clicks_count on facebook*/#[ORM\Column(nullable: true)]private ?int $pageLinkVideoClicksCount = null;#[ORM\Column(nullable: true)]private ?int $pagePostsImpressionsUnique = null;#[ORM\Column(length: 255, nullable: true)]private ?string $totalInteraction = null;#[ORM\Column(length: 255, nullable: true)]private ?string $pagePostsImpressions = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tweetsUrlLinkClicks = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tweetsUserProfileClicks = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tweetsRetweets = null;#[ORM\Column(length: 255, nullable: true)]private ?string $saveCount = null;#[ORM\Column(nullable: true)]private ?int $profilePostVideoViewsTotal = null;#[ORM\Column(nullable: true)]private ?int $profilePostReplays = null;#[ORM\Column(nullable: true)]private ?int $profilePostPlays = null;#[ORM\Column(nullable: true)]private ?int $profilePostReelsViewTotalTime = null;//for youtube#[ORM\Column(length: 255, nullable: true)]private ?string $channelDislikesCount = null;//for youtube#[ORM\Column(length: 255, nullable: true)]private ?string $channelVideosVideoViewCount = null;//for youtube#[ORM\Column(length: 255, nullable: true)]private ?string $channelShortsVideoViewCount = null;#[ORM\Column(length: 255, nullable: true)]private ?string $facebookVideoViews10s = null;#[ORM\Column(length: 255, nullable: true)]private ?string $mediaViews = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tiktokerPostReach = null;#[ORM\Column(length: 255, nullable: true)]private ?string $tiktokerPostTotalTimeWatched = null;public function getId(): ?int{return $this->id;}public function getRecord(): ?RecordSocialMedia{return $this->record;}public function setRecord(?RecordSocialMedia $record): static{$this->record = $record;return $this;}public function getType(): ?string{return $this->type;}public function setType(?string $type): static{$this->type = $type;return $this;}public function getDate(): ?\DateTimeInterface{return $this->date;}public function setDate(\DateTimeInterface $date): static{$this->date = $date;return $this;}public function getMessage(): ?string{return $this->message;}public function setMessage(?string $message): static{$this->message = $message;return $this;}public function getLink(): ?string{return $this->link;}public function setLink(?string $link): static{$this->link = $link;return $this;}public function getImageLink(): ?string{return $this->imageLink;}public function setImageLink(?string $imageLink): static{$this->imageLink = $imageLink;return $this;}public function getLikeCount(): ?int{return $this->likeCount;}public function setLikeCount(?int $likeCount): static{$this->likeCount = $likeCount;return $this;}public function getCommentCount(): ?int{return $this->commentCount;}public function setCommentCount(?int $commentCount): static{$this->commentCount = $commentCount;return $this;}public function getShareCount(): ?int{return $this->shareCount;}public function setShareCount(?int $shareCount): static{$this->shareCount = $shareCount;return $this;}public function getEngagment(): ?int{return $this->engagment;}public function setEngagment(?int $engagment): static{$this->engagment = $engagment;return $this;}public function getReach(): ?int{return $this->reach;}public function setReach(?int $reach): static{$this->reach = $reach;return $this;}/*** @return int|null*/public function getInteractionSum(): ?int{return $this->likeCount + $this->commentCount + $this->shareCount + $this->saveCount;}public function getReference(): ?string{return $this->reference;}public function setReference(?string $reference): static{$this->reference = $reference;return $this;}public function getTwitterQuotes(): ?int{return $this->twitterQuotes;}public function setTwitterQuotes(?int $twitterQuotes): static{$this->twitterQuotes = $twitterQuotes;return $this;}public function getPagePostsImpressionsOrganicUnique(): ?int{return $this->pagePostsImpressionsOrganicUnique;}public function setPagePostsImpressionsOrganicUnique(?int $pagePostsImpressionsOrganicUnique): static{$this->pagePostsImpressionsOrganicUnique = $pagePostsImpressionsOrganicUnique;return $this;}public function getPagePostsImpressionsPaidUnique(): ?int{return $this->pagePostsImpressionsPaidUnique;}public function setPagePostsImpressionsPaidUnique(?int $pagePostsImpressionsPaidUnique): static{$this->pagePostsImpressionsPaidUnique = $pagePostsImpressionsPaidUnique;return $this;}public function getPagePostsImpressionsOrganic(): ?int{return $this->pagePostsImpressionsOrganic;}public function setPagePostsImpressionsOrganic(?int $pagePostsImpressionsOrganic): static{$this->pagePostsImpressionsOrganic = $pagePostsImpressionsOrganic;return $this;}public function getPagePostImpressionsPaid(): ?int{return $this->pagePostImpressionsPaid;}public function setPagePostImpressionsPaid(?int $pagePostImpressionsPaid): static{$this->pagePostImpressionsPaid = $pagePostImpressionsPaid;return $this;}public function getFacebookVideoViewsTotal(): ?int{return $this->facebookVideoViewsTotal;}public function setFacebookVideoViewsTotal(?int $facebookVideoViewsTotal): static{$this->facebookVideoViewsTotal = $facebookVideoViewsTotal;return $this;}public function getFacebookVideoViewscompleteTotal(): ?int{return $this->facebookVideoViewscompleteTotal;}public function setFacebookVideoViewscompleteTotal(?int $facebookVideoViewscompleteTotal): static{$this->facebookVideoViewscompleteTotal = $facebookVideoViewscompleteTotal;return $this;}public function getFacebookVideoViewTime(): ?int{return $this->facebookVideoViewTime;}public function setFacebookVideoViewTime(?int $facebookVideoViewTime): static{$this->facebookVideoViewTime = $facebookVideoViewTime;return $this;}public function getFacebookReelViewsTotal(): ?int{return $this->facebookReelViewsTotal;}public function setFacebookReelViewsTotal(?int $facebookReelViewsTotal): static{$this->facebookReelViewsTotal = $facebookReelViewsTotal;return $this;}public function getFacebookReelViewsCompleteTotal(): ?int{return $this->facebookReelViewsCompleteTotal;}public function setFacebookReelViewsCompleteTotal(?int $facebookReelViewsCompleteTotal): static{$this->facebookReelViewsCompleteTotal = $facebookReelViewsCompleteTotal;return $this;}public function getPageLinkVideoClicksCount(): ?int{return $this->pageLinkVideoClicksCount;}public function setPageLinkVideoClicksCount(?int $pageLinkVideoClicksCount): static{$this->pageLinkVideoClicksCount = $pageLinkVideoClicksCount;return $this;}public function getPagePostsImpressionsUnique(): ?int{return $this->pagePostsImpressionsUnique;}public function setPagePostsImpressionsUnique(?int $pagePostsImpressionsUnique): static{$this->pagePostsImpressionsUnique = $pagePostsImpressionsUnique;return $this;}public function isStory(): bool{return $this->getType() === 'STORY';}public function getTotalInteraction(): ?string{return $this->totalInteraction;}public function setTotalInteraction(?string $totalInteraction): static{$this->totalInteraction = $totalInteraction;return $this;}public function getPagePostsImpressions(): ?string{return $this->pagePostsImpressions;}public function setPagePostsImpressions(?string $pagePostsImpressions): static{$this->pagePostsImpressions = $pagePostsImpressions;return $this;}public function getTweetsUrlLinkClicks(): ?string{return $this->tweetsUrlLinkClicks;}public function setTweetsUrlLinkClicks(?string $tweetsUrlLinkClicks): static{$this->tweetsUrlLinkClicks = $tweetsUrlLinkClicks;return $this;}public function getTweetsUserProfileClicks(): ?string{return $this->tweetsUserProfileClicks;}public function setTweetsUserProfileClicks(?string $tweetsUserProfileClicks): static{$this->tweetsUserProfileClicks = $tweetsUserProfileClicks;return $this;}public function getTweetsRetweets(): ?string{return $this->tweetsRetweets;}public function setTweetsRetweets(?string $tweetsRetweets): static{$this->tweetsRetweets = $tweetsRetweets;return $this;}public function getSaveCount(): ?string{return $this->saveCount;}public function setSaveCount(?string $saveCount): static{$this->saveCount = $saveCount;return $this;}public function getProfilePostVideoViewsTotal(): ?int{return $this->profilePostVideoViewsTotal;}public function setProfilePostVideoViewsTotal(?int $profilePostVideoViewsTotal): static{$this->profilePostVideoViewsTotal = $profilePostVideoViewsTotal;return $this;}public function getProfilePostReplays(): ?int{return $this->profilePostReplays;}public function setProfilePostReplays(?int $profilePostReplays): static{$this->profilePostReplays = $profilePostReplays;return $this;}public function getProfilePostPlays(): ?int{return $this->profilePostPlays;}public function setProfilePostPlays(?int $profilePostPlays): static{$this->profilePostPlays = $profilePostPlays;return $this;}public function getProfilePostReelsViewTotalTime(): ?int{return $this->profilePostReelsViewTotalTime;}public function setProfilePostReelsViewTotalTime(?int $profilePostReelsViewTotalTime): static{$this->profilePostReelsViewTotalTime = $profilePostReelsViewTotalTime;return $this;}public function getPagePostsImpressionsOrganicAndPaid():?int{return $this->getPagePostsImpressionsOrganic() + $this->getPagePostImpressionsPaid();}/*** @return int|string|null*/public function getTwitterInteractions(): int|string|null{return $this->getLikeCount() + $this->getTweetsUrlLinkClicks() + $this->getTweetsUserProfileClicks() + $this->getTwitterQuotes() + $this->getTweetsRetweets() + $this->getCommentCount();}public function getChannelDislikesCount(): ?string{return $this->channelDislikesCount;}public function setChannelDislikesCount(?string $channelDislikesCount): static{$this->channelDislikesCount = $channelDislikesCount;return $this;}public function getChannelVideosVideoViewCount(): ?string{return $this->channelVideosVideoViewCount;}public function setChannelVideosVideoViewCount(?string $channelVideosVideoViewCount): static{$this->channelVideosVideoViewCount = $channelVideosVideoViewCount;return $this;}public function getChannelShortsVideoViewCount(): ?string{return $this->channelShortsVideoViewCount;}public function setChannelShortsVideoViewCount(?string $channelShortsVideoViewCount): static{$this->channelShortsVideoViewCount = $channelShortsVideoViewCount;return $this;}public function getTotalInteractionYoutube():?string{return $this->channelDislikesCount + $this->likeCount + $this->commentCount;}public function isShort(): bool{return $this->getType() === 'SHORTS';}/*** @return int|string|null*/public function getTotalInteractions(): int|string|null{return match ($this->getRecord()->getNetwork()) {SocialMedia::NETWORK_YOUTUBE => $this->getTotalInteractionYoutube(),SocialMedia::NETWORK_TWITTER => $this->getTwitterInteractions(),default => $this->getLikeCount()+ $this->getShareCount() + $this->getSaveCount()+ $this->getCommentCount()};}/*** @return int|null*/public function getSumInstagramEngagement():?int{return $this->getSaveCount() + $this->getShareCount() + $this->getLikeCount() + $this->getCommentCount();}/*** @return int|null*/public function getTotalEngagement(): ?int{return match ($this->getRecord()->getNetwork()) {SocialMedia::NETWORK_INSTAGRAM => $this->getSumInstagramEngagement(),SocialMedia::NETWORK_YOUTUBE => $this->getTotalInteractionYoutube(),SocialMedia::NETWORK_TWITTER => $this->getEngagementTwitter(),SocialMedia::NETWORK_TIKTOK => $this->getEngagementTiktok(),default => $this->getCommentCount() +$this->getShareCount() + $this->getLikeCount() + $this->getPageLinkVideoClicksCount()};}/*** @return int|string|null*/public function getEngagementTwitter(): int|string|null{return $this->getTweetsUrlLinkClicks() + $this->getTweetsUserProfileClicks() + $this->getTweetsRetweets() + $this->getTwitterQuotes() + $this->getLikeCount() + $this->getCommentCount();}/*** @return int|string|null*/public function getTotalImpression(): int|string|null{return match ($this->getRecord()->getNetwork()) {SocialMedia::NETWORK_INSTAGRAM, SocialMedia::NETWORK_YOUTUBE => $this->getPagePostsImpressions(),default => $this->getPagePostsImpressionsOrganic() + $this->getPagePostImpressionsPaid(),};}public function getFacebookVideoViews10s(): ?string{return $this->facebookVideoViews10s;}public function setFacebookVideoViews10s(?string $facebookVideoViews10s): static{$this->facebookVideoViews10s = $facebookVideoViews10s;return $this;}public function getMediaViews(): ?string{return $this->mediaViews;}public function setMediaViews(?string $mediaViews): static{$this->mediaViews = $mediaViews;return $this;}public function getTiktokerPostReach(): ?string{return $this->tiktokerPostReach;}public function setTiktokerPostReach(?string $tiktokerPostReach): static{$this->tiktokerPostReach = $tiktokerPostReach;return $this;}public function getTiktokerPostTotalTimeWatched(): ?string{return $this->tiktokerPostTotalTimeWatched;}public function setTiktokerPostTotalTimeWatched(?string $tiktokerPostTotalTimeWatched): static{$this->tiktokerPostTotalTimeWatched = $tiktokerPostTotalTimeWatched;return $this;}public function getEngagementTiktok(): ?int{return $this->getCommentCount() +$this->getShareCount() + $this->getLikeCount();}}