src/Products/SocialBundle/Entity/SocialAccount.php line 47

Open in your IDE?
  1. <?php
  2. namespace Products\SocialBundle\Entity;
  3. use Cms\TenantBundle\Entity\TenantedEntity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Products\SocialBundle\Entity\SocialAccounts\FacebookSocialAccount;
  6. use Products\SocialBundle\Entity\SocialAccounts\TwitterSocialAccount;
  7. /**
  8.  * Class FacebookSocialAccount
  9.  *
  10.  * @package Products\SocialBundle\Entity
  11.  *
  12.  * @ORM\Entity(
  13.  *     repositoryClass = "Products\SocialBundle\Doctrine\Repository\SocialAccountRepository"
  14.  * )
  15.  * @ORM\InheritanceType("SINGLE_TABLE")
  16.  * @ORM\DiscriminatorColumn(
  17.  *     name = "_discr",
  18.  *     type = "string"
  19.  * )
  20.  * @ORM\DiscriminatorMap({
  21.  *     FacebookSocialAccount::DISCR = "Products\SocialBundle\Entity\SocialAccounts\FacebookSocialAccount",
  22.  *     TwitterSocialAccount::DISCR = "Products\SocialBundle\Entity\SocialAccounts\TwitterSocialAccount",
  23.  * })
  24.  * @ORM\Table(
  25.  *      name = "smm__account",
  26.  *      uniqueConstraints = {
  27.  *          @ORM\UniqueConstraint(
  28.  *              name = "uidx__unique__facebook",
  29.  *              columns = {
  30.  *                  "tenant",
  31.  *                  "facebookPageId",
  32.  *              }
  33.  *          ),
  34.  *          @ORM\UniqueConstraint(
  35.  *              name = "uidx__unique__twitter",
  36.  *              columns = {
  37.  *                  "tenant",
  38.  *                  "twitterUserId",
  39.  *              }
  40.  *          ),
  41.  *      }
  42.  * )
  43.  */
  44. abstract class SocialAccount extends TenantedEntity
  45. {
  46.     const DISCR null;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(
  51.      *     type = "string",
  52.      *     nullable = false
  53.      * )
  54.      */
  55.     protected $name;
  56.     /**
  57.      * @var bool
  58.      *
  59.      * @ORM\Column(
  60.      *     type = "boolean",
  61.      *     nullable = false,
  62.      *     options = {
  63.      *         "default" = false,
  64.      *     }
  65.      * )
  66.      */
  67.     protected $auto false;
  68.     /**
  69.      * @return string
  70.      */
  71.     public function getName()
  72.     {
  73.         return $this->name;
  74.     }
  75.     /**
  76.      * @param string $value
  77.      * @return $this
  78.      */
  79.     public function setName($value)
  80.     {
  81.         $this->name $value;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return bool
  86.      */
  87.     public function isAuto()
  88.     {
  89.         return ($this->auto === true);
  90.     }
  91.     /**
  92.      * @param bool $value
  93.      * @return $this
  94.      */
  95.     public function setAuto($value)
  96.     {
  97.         $this->auto = ($value === true);
  98.         return $this;
  99.     }
  100. }