src/Entity/RecordSocialMedia.php line 17
<?phpnamespace App\Entity;use App\Repository\RecordSocialMediaRepository;use App\Traits\Timestamps;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: RecordSocialMediaRepository::class)]#[ORM\InheritanceType("SINGLE_TABLE")]#[ORM\DiscriminatorColumn(name: "discr", type: "string", length: 3)]#[ORM\DiscriminatorMap(["FCB" => RecordFacebook::class,"INS" => RecordInstagram::class,"TWI" => RecordTwitter::class,"YOU" => RecordYoutube::class,"TIK" => RecordTiktok::class])]#[ORM\HasLifecycleCallbacks]class RecordSocialMedia{use Timestamps;const REACH_METRIC_NAME = 'post_impressions_fan_unique';#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(fetch: 'EAGER',inversedBy: 'recordSocialMedia')]private ?SocialMedia $socialMedia = null;#[ORM\Column(length: 255, nullable: true)]private ?string $engagement = null;#[ORM\Column(length: 255, nullable: true)]private ?string $reach = null;#[ORM\Column(length: 255, nullable: true)]private ?string $totalFollowers = null;#[ORM\Column(length: 255, nullable: true)]private ?string $interaction = null;#[ORM\Column(type: Types::DATE_MUTABLE)]private ?\DateTimeInterface $date = null;#[ORM\Column(length: 255, nullable: true)]private ?string $postsCount = null;#[ORM\Column(length: 255, nullable: true)]private ?string $postsPerDay = null;#[ORM\Column(length: 255, nullable: true)]private ?string $paidReach = null;#[ORM\Column(length: 255, nullable: true)]private ?string $organicReach = null;#[ORM\Column(nullable: true)]private ?int $postsLikes = 0;#[ORM\Column(nullable: true)]private ?int $videoPostCount = null;#[ORM\Column(nullable: true)]private ?int $ReelsShortsPostCount = null;#[ORM\Column(nullable: true)]private ?int $picturePostCount = null;#[ORM\OneToMany(mappedBy: 'record', targetEntity: PostRecord::class,cascade: ['persist'], orphanRemoval: true)]private Collection $postRecords;#[ORM\Column(nullable: true)]private ?int $postInteraction = null;#[ORM\Column(nullable: true)]private ?int $impressions = null;#[ORM\Column(nullable: true)]private ?int $pageViews = null;public function __construct(){$this->postRecords = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getSocialMedia(): ?SocialMedia{return $this->socialMedia;}public function setSocialMedia(?SocialMedia $socialMedia): static{$this->socialMedia = $socialMedia;return $this;}public function getEngagement(): ?string{return $this->engagement;}public function setEngagement(?string $engagement): static{$this->engagement = $engagement;return $this;}public function getReach(): ?string{return $this->reach;}public function setReach(?string $reach): static{$this->reach = $reach;return $this;}public function getTotalFollowers(): ?string{return $this->totalFollowers;}public function setTotalFollowers(?string $totalFollowers): static{$this->totalFollowers = $totalFollowers;return $this;}public function getInteraction(): ?string{return $this->interaction;}public function setInteraction(?string $interaction): static{$this->interaction = $interaction;return $this;}public function getDate(): ?\DateTimeInterface{return $this->date;}public function setDate(\DateTimeInterface $date): static{$this->date = $date;return $this;}public function getPostsCount(): ?string{return $this->postsCount;}public function setPostsCount(?string $postsCount): static{$this->postsCount = $postsCount;return $this;}public function getPostsPerDay(): ?string{return $this->postsPerDay;}public function setPostsPerDay(?string $postsPerDay): static{$this->postsPerDay = $postsPerDay;return $this;}public function getPaidReach(): ?string{return $this->paidReach;}public function setPaidReach(?string $paidReach): static{$this->paidReach = $paidReach;return $this;}public function getOrganicReach(): ?string{return $this->organicReach;}public function setOrganicReach(?string $organicReach): static{$this->organicReach = $organicReach;return $this;}public function getPostsLikes(): ?int{return $this->postsLikes;}public function setPostsLikes(?int $postsLikes): static{$this->postsLikes = $postsLikes;return $this;}public function getVideoPostCount(): ?int{return $this->videoPostCount;}public function setVideoPostCount(?int $videoPostCount): static{$this->videoPostCount = $videoPostCount;return $this;}public function getReelsShortsPostCount(): ?int{return $this->ReelsShortsPostCount;}public function setReelsShortsPostCount(?int $ReelsShortsPostCount): static{$this->ReelsShortsPostCount = $ReelsShortsPostCount;return $this;}public function getPicturePostCount(): ?int{return $this->picturePostCount;}public function setPicturePostCount(?int $picturePostCount): static{$this->picturePostCount = $picturePostCount;return $this;}/*** @return Collection<int, PostRecord>*/public function getPostRecords(): Collection{return $this->postRecords;}public function addPostRecord(PostRecord $postRecord): static{if (!$this->postRecords->contains($postRecord)) {$this->postRecords->add($postRecord);$postRecord->setRecord($this);}return $this;}public function removePostRecord(PostRecord $postRecord): static{if ($this->postRecords->removeElement($postRecord)) {// set the owning side to null (unless already changed)if ($postRecord->getRecord() === $this) {$postRecord->setRecord(null);}}return $this;}public function getPostInteraction(): ?int{return $this->postInteraction;}public function setPostInteraction(?int $postInteraction): static{$this->postInteraction = $postInteraction;return $this;}public function isFacebook(): bool{return false;}public function isTiktok(): bool{return false;}public function isTwitter(): bool{return false;}public function isInstagram(): bool{return false;}public function isYoutube(): bool{return false;}public function getReachMetricName(): ?string{return self::REACH_METRIC_NAME;}public function getImpressions(): ?int{return $this->impressions;}public function setImpressions(?int $impressions): static{$this->impressions = $impressions;return $this;}public function getPageViews(): ?int{return $this->pageViews;}public function setPageViews(?int $pageViews): static{$this->pageViews = $pageViews;return $this;}public function getNetwork(): ?string{return $this->getSocialMedia()->getNetwork();}}