src/Entity/Influencer.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InfluencerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=InfluencerRepository::class)
  11. * @ORM\Table(name="influencer", indexes={
  12.  *     @ORM\Index(name="slug_idx", columns={"slug"})
  13.  * })
  14.  * @UniqueEntity(
  15.  *     fields={"name"},
  16.  *     errorPath="name",
  17.  *     message="This influencer already exist"
  18.  * )
  19.  */
  20. class Influencer
  21. {
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @Assert\Length(
  30.      *      min = 3,
  31.      *      max = 30,
  32.      *      minMessage = "Name must be at least {{ limit }} characters long",
  33.      *      maxMessage = "Name cannot be longer than {{ limit }} characters"
  34.      * )
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $name;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $description;
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      */
  45.     private $slug;
  46.     /**
  47.      * @ORM\Column(type="smallint", nullable=true)
  48.      * @Assert\Positive
  49.      */
  50.     private $age;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $country;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $instagram;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $onlyfans;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     private $mym;
  67.     /**
  68.      * @ORM\Column(type="datetime_immutable")
  69.      */
  70.     private $created_at;
  71.     /**
  72.      * @ORM\Column(type="datetime")
  73.      */
  74.     private $updated_at;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity=Photo::class, mappedBy="influencer", orphanRemoval=true)
  77.      */
  78.     private $photos;
  79.     /**
  80.      * @ORM\OneToOne(targetEntity=Photo::class, cascade={"persist", "remove"})
  81.      */
  82.     private $main_photo;
  83.     /**
  84.      * @ORM\Column(type="boolean")
  85.      */
  86.     private $actif;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $chaturbate;
  91.     /**
  92.      * @ORM\Column(type="string", length=255, nullable=true)
  93.      */
  94.     private $stripchat;
  95.     /**
  96.      * @ORM\OneToMany(targetEntity=InfluencerFollower::class, mappedBy="influencer", orphanRemoval=true)
  97.      */
  98.     private $influencerFollowers;
  99.     /**
  100.      * @ORM\OneToMany(targetEntity=Comment::class, mappedBy="influencer_id")
  101.      */
  102.     private $comments;
  103.     /**
  104.      * @ORM\OneToMany(targetEntity=Video::class, mappedBy="influencer", orphanRemoval=true)
  105.      */
  106.     private $videos;
  107.     /**
  108.      * @ORM\Column(type="string", length=255, nullable=true)
  109.      */
  110.     private $fansly;
  111.     /**
  112.      * @ORM\Column(type="string", length=255, nullable=true)
  113.      */
  114.     private $patreon;
  115.     /**
  116.      * @ORM\Column(type="string", length=255, nullable=true)
  117.      */
  118.     private $swame;
  119.     public function __construct()
  120.     {
  121.         $this->created_at = new \DateTimeImmutable();
  122.         $this->updated_at = new \DateTime();
  123.         $this->photos = new ArrayCollection();
  124.         $this->actif 1;
  125.         $this->influencerFollowers = new ArrayCollection();
  126.         $this->comments = new ArrayCollection();
  127.         $this->videos = new ArrayCollection();
  128.     }
  129.     public function getId(): ?int
  130.     {
  131.         return $this->id;
  132.     }
  133.     public function getName(): ?string
  134.     {
  135.         return $this->name;
  136.     }
  137.     public function setName(string $name): self
  138.     {
  139.         $this->name $name;
  140.         return $this;
  141.     }
  142.     public function getDescription(): ?string
  143.     {
  144.         return $this->description;
  145.     }
  146.     public function setDescription(?string $description): self
  147.     {
  148.         $this->description $description;
  149.         return $this;
  150.     }
  151.     public function getSlug(): ?string
  152.     {
  153.         return $this->slug;
  154.     }
  155.     public function setSlug(string $slug): self
  156.     {
  157.         $this->slug $slug;
  158.         return $this;
  159.     }
  160.     public function getAge(): ?int
  161.     {
  162.         return $this->age;
  163.     }
  164.     public function setAge(?int $age): self
  165.     {
  166.         $this->age $age;
  167.         return $this;
  168.     }
  169.     public function getCountry(): ?string
  170.     {
  171.         return $this->country;
  172.     }
  173.     public function setCountry(?string $country): self
  174.     {
  175.         $this->country $country;
  176.         return $this;
  177.     }
  178.     public function getInstagram(): ?string
  179.     {
  180.         return $this->instagram;
  181.     }
  182.     public function setInstagram(?string $instagram): self
  183.     {
  184.         $this->instagram $instagram;
  185.         return $this;
  186.     }
  187.     public function getOnlyfans(): ?string
  188.     {
  189.         return $this->onlyfans;
  190.     }
  191.     public function setOnlyfans(?string $onlyfans): self
  192.     {
  193.         $this->onlyfans $onlyfans;
  194.         return $this;
  195.     }
  196.     public function getMym(): ?string
  197.     {
  198.         return $this->mym;
  199.     }
  200.     public function setMym(?string $mym): self
  201.     {
  202.         $this->mym $mym;
  203.         return $this;
  204.     }
  205.     public function getCreatedAt(): ?\DateTimeImmutable
  206.     {
  207.         return $this->created_at;
  208.     }
  209.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  210.     {
  211.         $this->created_at $created_at;
  212.         return $this;
  213.     }
  214.     public function getUpdatedAt(): ?\DateTimeInterface
  215.     {
  216.         return $this->updated_at;
  217.     }
  218.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  219.     {
  220.         $this->updated_at $updated_at;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return Collection<int, Photo>
  225.      */
  226.     public function getPhotos(): Collection
  227.     {
  228.         return $this->photos;
  229.     }
  230.     public function addPhoto(Photo $photo): self
  231.     {
  232.         if (!$this->photos->contains($photo)) {
  233.             $this->photos[] = $photo;
  234.             $photo->setInfluencer($this);
  235.         }
  236.         return $this;
  237.     }
  238.     public function removePhoto(Photo $photo): self
  239.     {
  240.         if ($this->photos->removeElement($photo)) {
  241.             // set the owning side to null (unless already changed)
  242.             if ($photo->getInfluencer() === $this) {
  243.                 $photo->setInfluencer(null);
  244.             }
  245.         }
  246.         return $this;
  247.     }
  248.     public function getMainPhoto(): ?Photo
  249.     {
  250.         return $this->main_photo;
  251.     }
  252.     public function setMainPhoto(?Photo $main_photo): self
  253.     {
  254.         $this->main_photo $main_photo;
  255.         return $this;
  256.     }
  257.     public function getActif(): ?bool
  258.     {
  259.         return $this->actif;
  260.     }
  261.     public function setActif(bool $actif): self
  262.     {
  263.         $this->actif $actif;
  264.         return $this;
  265.     }
  266.     public function getChaturbate(): ?string
  267.     {
  268.         return $this->chaturbate;
  269.     }
  270.     public function setChaturbate(?string $chaturbate): self
  271.     {
  272.         $this->chaturbate $chaturbate;
  273.         return $this;
  274.     }
  275.     public function getStripchat(): ?string
  276.     {
  277.         return $this->stripchat;
  278.     }
  279.     public function setStripchat(?string $stripchat): self
  280.     {
  281.         $this->stripchat $stripchat;
  282.         return $this;
  283.     }
  284.     /**
  285.      * @return Collection<int, InfluencerFollower>
  286.      */
  287.     public function getInfluencerFollowers(): Collection
  288.     {
  289.         return $this->influencerFollowers;
  290.     }
  291.     public function addInfluencerFollower(InfluencerFollower $influencerFollower): self
  292.     {
  293.         if (!$this->influencerFollowers->contains($influencerFollower)) {
  294.             $this->influencerFollowers[] = $influencerFollower;
  295.             $influencerFollower->setInfluencer($this);
  296.         }
  297.         return $this;
  298.     }
  299.     public function removeInfluencerFollower(InfluencerFollower $influencerFollower): self
  300.     {
  301.         if ($this->influencerFollowers->removeElement($influencerFollower)) {
  302.             // set the owning side to null (unless already changed)
  303.             if ($influencerFollower->getInfluencer() === $this) {
  304.                 $influencerFollower->setInfluencer(null);
  305.             }
  306.         }
  307.         return $this;
  308.     }
  309.     /**
  310.      * @return Collection<int, Comment>
  311.      */
  312.     public function getComments(): Collection
  313.     {
  314.         return $this->comments;
  315.     }
  316.     public function addComment(Comment $comment): self
  317.     {
  318.         if (!$this->comments->contains($comment)) {
  319.             $this->comments[] = $comment;
  320.             $comment->setInfluencerId($this);
  321.         }
  322.         return $this;
  323.     }
  324.     public function removeComment(Comment $comment): self
  325.     {
  326.         if ($this->comments->removeElement($comment)) {
  327.             // set the owning side to null (unless already changed)
  328.             if ($comment->getInfluencerId() === $this) {
  329.                 $comment->setInfluencerId(null);
  330.             }
  331.         }
  332.         return $this;
  333.     }
  334.     /**
  335.      * @return Collection<int, Video>
  336.      */
  337.     public function getVideos(): Collection
  338.     {
  339.         return $this->videos;
  340.     }
  341.     public function addVideo(Video $video): self
  342.     {
  343.         if (!$this->videos->contains($video)) {
  344.             $this->videos[] = $video;
  345.             $video->setInfluencer($this);
  346.         }
  347.         return $this;
  348.     }
  349.     public function removeVideo(Video $video): self
  350.     {
  351.         if ($this->videos->removeElement($video)) {
  352.             // set the owning side to null (unless already changed)
  353.             if ($video->getInfluencer() === $this) {
  354.                 $video->setInfluencer(null);
  355.             }
  356.         }
  357.         return $this;
  358.     }
  359.     public function getFansly(): ?string
  360.     {
  361.         return $this->fansly;
  362.     }
  363.     public function setFansly(?string $fansly): self
  364.     {
  365.         $this->fansly $fansly;
  366.         return $this;
  367.     }
  368.     public function getPatreon(): ?string
  369.     {
  370.         return $this->patreon;
  371.     }
  372.     public function setPatreon(?string $patreon): self
  373.     {
  374.         $this->patreon $patreon;
  375.         return $this;
  376.     }
  377.     public function getSwame(): ?string
  378.     {
  379.         return $this->swame;
  380.     }
  381.     public function setSwame(?string $swame): self
  382.     {
  383.         $this->swame $swame;
  384.         return $this;
  385.     }
  386. }