<?php
namespace Products\SocialBundle\Entity;
use Cms\TenantBundle\Entity\TenantedEntity;
use Doctrine\ORM\Mapping as ORM;
use Products\SocialBundle\Entity\SocialAccounts\FacebookSocialAccount;
use Products\SocialBundle\Entity\SocialAccounts\TwitterSocialAccount;
/**
* Class FacebookSocialAccount
*
* @package Products\SocialBundle\Entity
*
* @ORM\Entity(
* repositoryClass = "Products\SocialBundle\Doctrine\Repository\SocialAccountRepository"
* )
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(
* name = "_discr",
* type = "string"
* )
* @ORM\DiscriminatorMap({
* FacebookSocialAccount::DISCR = "Products\SocialBundle\Entity\SocialAccounts\FacebookSocialAccount",
* TwitterSocialAccount::DISCR = "Products\SocialBundle\Entity\SocialAccounts\TwitterSocialAccount",
* })
* @ORM\Table(
* name = "smm__account",
* uniqueConstraints = {
* @ORM\UniqueConstraint(
* name = "uidx__unique__facebook",
* columns = {
* "tenant",
* "facebookPageId",
* }
* ),
* @ORM\UniqueConstraint(
* name = "uidx__unique__twitter",
* columns = {
* "tenant",
* "twitterUserId",
* }
* ),
* }
* )
*/
abstract class SocialAccount extends TenantedEntity
{
const DISCR = null;
/**
* @var string
*
* @ORM\Column(
* type = "string",
* nullable = false
* )
*/
protected $name;
/**
* @var bool
*
* @ORM\Column(
* type = "boolean",
* nullable = false,
* options = {
* "default" = false,
* }
* )
*/
protected $auto = false;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $value
* @return $this
*/
public function setName($value)
{
$this->name = $value;
return $this;
}
/**
* @return bool
*/
public function isAuto()
{
return ($this->auto === true);
}
/**
* @param bool $value
* @return $this
*/
public function setAuto($value)
{
$this->auto = ($value === true);
return $this;
}
}