src/App/Entity/System/SocialAccounts/TwitterSocialAccount.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System\SocialAccounts;
  3. use App\Entity\System\SocialAccount;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Class TwitterSocialAccount
  7.  * @package Products\SocialBundle\Entity\SocialAccounts
  8.  *
  9.  * @ORM\Entity(
  10.  *     repositoryClass = "App\Doctrine\Repository\System\SocialAccounts\TwitterSocialAccountRepository",
  11.  * )
  12.  */
  13. class TwitterSocialAccount extends SocialAccount
  14. {
  15.     const DISCR 'twitter';
  16.     /**
  17.      * @var string|null
  18.      *
  19.      * @ORM\Column(
  20.      *     type = "string",
  21.      *     nullable = false,
  22.      * )
  23.      */
  24.     protected ?string $twitterUserId null;
  25.     /**
  26.      * @var string|null
  27.      *
  28.      * @ORM\Column(
  29.      *     type = "string",
  30.      *     nullable = false,
  31.      * )
  32.      */
  33.     protected ?string $twitterUserName null;
  34.     /**
  35.      * @var string|null
  36.      *
  37.      * @ORM\Column(
  38.      *     type = "string",
  39.      *     nullable = false,
  40.      * )
  41.      */
  42.     protected ?string $twitterAccessToken null;
  43.     /**
  44.      * @var string|null
  45.      *
  46.      * @ORM\Column(
  47.      *     type = "string",
  48.      *     nullable = false,
  49.      * )
  50.      */
  51.     protected ?string $twitterTokenSecret null;
  52.     /**
  53.      * @return string|null
  54.      */
  55.     public function getTwitterUserId(): ?string
  56.     {
  57.         return $this->twitterUserId;
  58.     }
  59.     /**
  60.      * @param string $twitterUserId
  61.      * @return $this
  62.      */
  63.     public function setTwitterUserId(string $twitterUserId): self
  64.     {
  65.         $this->twitterUserId $twitterUserId;
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return string|null
  70.      */
  71.     public function getTwitterUserName(): ?string
  72.     {
  73.         return $this->twitterUserName;
  74.     }
  75.     /**
  76.      * @param string $twitterUserName
  77.      * @return $this
  78.      */
  79.     public function setTwitterUserName(string $twitterUserName): self
  80.     {
  81.         $this->twitterUserName $twitterUserName;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return string|null
  86.      */
  87.     public function getTwitterAccessToken(): ?string
  88.     {
  89.         return $this->twitterAccessToken;
  90.     }
  91.     /**
  92.      * @param string $twitterAccessToken
  93.      * @return $this
  94.      */
  95.     public function setTwitterAccessToken(string $twitterAccessToken): self
  96.     {
  97.         $this->twitterAccessToken $twitterAccessToken;
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return string|null
  102.      */
  103.     public function getTwitterTokenSecret(): ?string
  104.     {
  105.         return $this->twitterTokenSecret;
  106.     }
  107.     /**
  108.      * @param string $twitterTokenSecret
  109.      * @return $this
  110.      */
  111.     public function setTwitterTokenSecret(string $twitterTokenSecret): self
  112.     {
  113.         $this->twitterTokenSecret $twitterTokenSecret;
  114.         return $this;
  115.     }
  116.     /**
  117.      * {@inheritDoc}
  118.      */
  119.     public function __toString(): string
  120.     {
  121.         return sprintf(
  122.             '%s / @%s',
  123.             $this->getTwitterUserId(),
  124.             $this->getTwitterUserName()
  125.         );
  126.     }
  127.     /**
  128.      * {@inheritDoc}
  129.      */
  130.     public function getIdentifier(): ?string
  131.     {
  132.         return $this->getTwitterUserId();
  133.     }
  134. }