src/Entity/SocialMedia.php line 19
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\SocialMediaRepository;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: SocialMediaRepository::class)]#[ApiResource(normalizationContext: ['groups' => ['social_media:read']],denormalizationContext: ['groups' => ['social_media:write']])]#[ORM\HasLifecycleCallbacks]class SocialMedia{public CONST NETWORK_INSTAGRAM = 'instagram';public CONST NETWORK_YOUTUBE = 'youtube';public CONST NETWORK_TWITTER = 'twitter';public CONST NETWORK_TIKTOK = 'tiktok';public CONST NETWORK_FACEBOOK = 'facebook';use Timestamps;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $url = null;#[ORM\Column(length: 255)]private ?string $network = null;#[ORM\Column(length: 255, nullable: true)]private ?string $profileId = null;#[ORM\Column(length: 255, nullable: true)]private ?string $clientExternalId = null;#[ORM\Column]private ?bool $status = false;#[ORM\OneToMany(mappedBy: 'socialMedia', targetEntity: RecordSocialMedia::class,cascade: ['persist'], orphanRemoval: true)]private Collection $recordSocialMedia;#[ORM\Column(length: 255, nullable: true)]private ?string $profileName = null;#[ORM\Column]private ?bool $collectData = true;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $thumbnail = null;#[ORM\Column(type: 'boolean', options: ['default' => false])]private ?bool $seen = false;#[ORM\Column]private ?bool $oldDataCollected = false;public function __construct(){$this->recordSocialMedia = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getUrl(): ?string{return $this->url;}public function setUrl(?string $url): self{$this->url = $url;return $this;}public function getNetwork(): ?string{return $this->network;}public function setNetwork(string $network): self{$this->network = $network;return $this;}public function getProfileId(): ?string{return $this->profileId;}public function setProfileId(?string $profileId): self{$this->profileId = $profileId;return $this;}public function getClientExternalId(): ?string{return $this->clientExternalId;}public function setClientExternalId(?string $clientExternalId): self{$this->clientExternalId = $clientExternalId;return $this;}public function isStatus(): ?bool{return $this->status;}public function setStatus(bool $status): static{$this->status = $status;return $this;}/*** @return Collection<int, RecordSocialMedia>*/public function getRecordSocialMedia(): Collection{return $this->recordSocialMedia;}public function addRecordSocialMedium(RecordSocialMedia $recordSocialMedium): static{if (!$this->recordSocialMedia->contains($recordSocialMedium)) {$this->recordSocialMedia->add($recordSocialMedium);$recordSocialMedium->setSocialMedia($this);}return $this;}public function removeRecordSocialMedium(RecordSocialMedia $recordSocialMedium): static{if ($this->recordSocialMedia->removeElement($recordSocialMedium)) {// set the owning side to null (unless already changed)if ($recordSocialMedium->getSocialMedia() === $this) {$recordSocialMedium->setSocialMedia(null);}}return $this;}public function getProfileName(): ?string{return $this->profileName;}public function __toString(): string{return $this->profileName ?? '';}public function setProfileName(?string $profileName): static{$this->profileName = $profileName;return $this;}public function isCollectData(): ?bool{return $this->collectData;}public function setCollectData(bool $collectData): static{$this->collectData = $collectData;return $this;}public function getThumbnail(): ?string{return $this->thumbnail;}public function setThumbnail(?string $thumbnail): static{$this->thumbnail = $thumbnail;return $this;}public function isSeen(): ?bool{return $this->seen;}public function setSeen(bool $seen): static{$this->seen = $seen;return $this;}public function isOldDataCollected(): ?bool{return $this->oldDataCollected;}public function setOldDataCollected(bool $oldDataCollected): static{$this->oldDataCollected = $oldDataCollected;return $this;}public function isInstagram(): bool{return $this->network === self::NETWORK_INSTAGRAM;}}