src/Entity/CRM/SocialPlatform.php line 12

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\CRM\SocialPlatformRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassSocialPlatformRepository::class)]
  9. class SocialPlatform
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(length50nullabletrue)]
  18.     private ?string $type null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?bool $isActive true;
  21.     #[ORM\Column(length500nullabletrue)]
  22.     private ?string $pageId null;
  23.     #[ORM\Column(length500nullabletrue)]
  24.     private ?string $facebookPageId null;
  25.     #[ORM\Column(length1000nullabletrue)]
  26.     private ?string $accessToken null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $defaultCommentContent null;
  29.     #[ORM\OneToMany(mappedBy'socialPlatform'targetEntitySocialPostPlatform::class, orphanRemovaltrue)]
  30.     private Collection $socialPostPlatforms;
  31.     public function __construct()
  32.     {
  33.         $this->socialPostPlatforms = new ArrayCollection();
  34.     }
  35.     public function __toString(): string
  36.     {
  37.         return $this->name ?? '';
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): static
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     public function getType(): ?string
  53.     {
  54.         return $this->type;
  55.     }
  56.     public function setType(?string $type): static
  57.     {
  58.         $this->type $type;
  59.         return $this;
  60.     }
  61.     public function isIsActive(): ?bool
  62.     {
  63.         return $this->isActive;
  64.     }
  65.     public function setIsActive(?bool $isActive): static
  66.     {
  67.         $this->isActive $isActive;
  68.         return $this;
  69.     }
  70.     public function getPageId(): ?string
  71.     {
  72.         return $this->pageId;
  73.     }
  74.     public function setPageId(?string $pageId): static
  75.     {
  76.         $this->pageId $pageId;
  77.         return $this;
  78.     }
  79.     public function getFacebookPageId(): ?string
  80.     {
  81.         return $this->facebookPageId;
  82.     }
  83.     public function setFacebookPageId(?string $facebookPageId): static
  84.     {
  85.         $this->facebookPageId $facebookPageId;
  86.         return $this;
  87.     }
  88.     public function getAccessToken(): ?string
  89.     {
  90.         return $this->accessToken;
  91.     }
  92.     public function setAccessToken(?string $accessToken): static
  93.     {
  94.         $this->accessToken $accessToken;
  95.         return $this;
  96.     }
  97.     public function getDefaultCommentContent(): ?string
  98.     {
  99.         return $this->defaultCommentContent;
  100.     }
  101.     public function setDefaultCommentContent(?string $defaultCommentContent): static
  102.     {
  103.         $this->defaultCommentContent $defaultCommentContent;
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection<int, SocialPostPlatform>
  108.      */
  109.     public function getSocialPostPlatforms(): Collection
  110.     {
  111.         return $this->socialPostPlatforms;
  112.     }
  113.     public function addSocialPostPlatform(SocialPostPlatform $socialPostPlatform): static
  114.     {
  115.         if (!$this->socialPostPlatforms->contains($socialPostPlatform)) {
  116.             $this->socialPostPlatforms->add($socialPostPlatform);
  117.             $socialPostPlatform->setSocialPlatform($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeSocialPostPlatform(SocialPostPlatform $socialPostPlatform): static
  122.     {
  123.         if ($this->socialPostPlatforms->removeElement($socialPostPlatform)) {
  124.             if ($socialPostPlatform->getSocialPlatform() === $this) {
  125.                 $socialPostPlatform->setSocialPlatform(null);
  126.             }
  127.         }
  128.         return $this;
  129.     }
  130. }