<?php
namespace App\Entity;
use App\Repository\InfluencerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=InfluencerRepository::class)
* @ORM\Table(name="influencer", indexes={
* @ORM\Index(name="slug_idx", columns={"slug"})
* })
* @UniqueEntity(
* fields={"name"},
* errorPath="name",
* message="This influencer already exist"
* )
*/
class Influencer
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @Assert\Length(
* min = 3,
* max = 30,
* minMessage = "Name must be at least {{ limit }} characters long",
* maxMessage = "Name cannot be longer than {{ limit }} characters"
* )
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\Column(type="smallint", nullable=true)
* @Assert\Positive
*/
private $age;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $country;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $instagram;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $onlyfans;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mym;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity=Photo::class, mappedBy="influencer", orphanRemoval=true)
*/
private $photos;
/**
* @ORM\OneToOne(targetEntity=Photo::class, cascade={"persist", "remove"})
*/
private $main_photo;
/**
* @ORM\Column(type="boolean")
*/
private $actif;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $chaturbate;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $stripchat;
/**
* @ORM\OneToMany(targetEntity=InfluencerFollower::class, mappedBy="influencer", orphanRemoval=true)
*/
private $influencerFollowers;
/**
* @ORM\OneToMany(targetEntity=Comment::class, mappedBy="influencer_id")
*/
private $comments;
/**
* @ORM\OneToMany(targetEntity=Video::class, mappedBy="influencer", orphanRemoval=true)
*/
private $videos;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fansly;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $patreon;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $swame;
public function __construct()
{
$this->created_at = new \DateTimeImmutable();
$this->updated_at = new \DateTime();
$this->photos = new ArrayCollection();
$this->actif = 1;
$this->influencerFollowers = new ArrayCollection();
$this->comments = new ArrayCollection();
$this->videos = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getAge(): ?int
{
return $this->age;
}
public function setAge(?int $age): self
{
$this->age = $age;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getInstagram(): ?string
{
return $this->instagram;
}
public function setInstagram(?string $instagram): self
{
$this->instagram = $instagram;
return $this;
}
public function getOnlyfans(): ?string
{
return $this->onlyfans;
}
public function setOnlyfans(?string $onlyfans): self
{
$this->onlyfans = $onlyfans;
return $this;
}
public function getMym(): ?string
{
return $this->mym;
}
public function setMym(?string $mym): self
{
$this->mym = $mym;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
/**
* @return Collection<int, Photo>
*/
public function getPhotos(): Collection
{
return $this->photos;
}
public function addPhoto(Photo $photo): self
{
if (!$this->photos->contains($photo)) {
$this->photos[] = $photo;
$photo->setInfluencer($this);
}
return $this;
}
public function removePhoto(Photo $photo): self
{
if ($this->photos->removeElement($photo)) {
// set the owning side to null (unless already changed)
if ($photo->getInfluencer() === $this) {
$photo->setInfluencer(null);
}
}
return $this;
}
public function getMainPhoto(): ?Photo
{
return $this->main_photo;
}
public function setMainPhoto(?Photo $main_photo): self
{
$this->main_photo = $main_photo;
return $this;
}
public function getActif(): ?bool
{
return $this->actif;
}
public function setActif(bool $actif): self
{
$this->actif = $actif;
return $this;
}
public function getChaturbate(): ?string
{
return $this->chaturbate;
}
public function setChaturbate(?string $chaturbate): self
{
$this->chaturbate = $chaturbate;
return $this;
}
public function getStripchat(): ?string
{
return $this->stripchat;
}
public function setStripchat(?string $stripchat): self
{
$this->stripchat = $stripchat;
return $this;
}
/**
* @return Collection<int, InfluencerFollower>
*/
public function getInfluencerFollowers(): Collection
{
return $this->influencerFollowers;
}
public function addInfluencerFollower(InfluencerFollower $influencerFollower): self
{
if (!$this->influencerFollowers->contains($influencerFollower)) {
$this->influencerFollowers[] = $influencerFollower;
$influencerFollower->setInfluencer($this);
}
return $this;
}
public function removeInfluencerFollower(InfluencerFollower $influencerFollower): self
{
if ($this->influencerFollowers->removeElement($influencerFollower)) {
// set the owning side to null (unless already changed)
if ($influencerFollower->getInfluencer() === $this) {
$influencerFollower->setInfluencer(null);
}
}
return $this;
}
/**
* @return Collection<int, Comment>
*/
public function getComments(): Collection
{
return $this->comments;
}
public function addComment(Comment $comment): self
{
if (!$this->comments->contains($comment)) {
$this->comments[] = $comment;
$comment->setInfluencerId($this);
}
return $this;
}
public function removeComment(Comment $comment): self
{
if ($this->comments->removeElement($comment)) {
// set the owning side to null (unless already changed)
if ($comment->getInfluencerId() === $this) {
$comment->setInfluencerId(null);
}
}
return $this;
}
/**
* @return Collection<int, Video>
*/
public function getVideos(): Collection
{
return $this->videos;
}
public function addVideo(Video $video): self
{
if (!$this->videos->contains($video)) {
$this->videos[] = $video;
$video->setInfluencer($this);
}
return $this;
}
public function removeVideo(Video $video): self
{
if ($this->videos->removeElement($video)) {
// set the owning side to null (unless already changed)
if ($video->getInfluencer() === $this) {
$video->setInfluencer(null);
}
}
return $this;
}
public function getFansly(): ?string
{
return $this->fansly;
}
public function setFansly(?string $fansly): self
{
$this->fansly = $fansly;
return $this;
}
public function getPatreon(): ?string
{
return $this->patreon;
}
public function setPatreon(?string $patreon): self
{
$this->patreon = $patreon;
return $this;
}
public function getSwame(): ?string
{
return $this->swame;
}
public function setSwame(?string $swame): self
{
$this->swame = $swame;
return $this;
}
}