src/AtechNet/CoreBundle/Entity/CustomerLink.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use App\AtechNet\CoreBundle\Repository\CustomerLinkRepository;
  4. use Doctrine\ORM\Mapping\Column;
  5. use Doctrine\ORM\Mapping\Entity;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\ManyToOne;
  8. use Doctrine\ORM\Mapping\Table as Table;
  9. /**
  10.  * CustomerLink
  11.  *
  12.  * @Table(name="customers__links")
  13.  * @Entity(repositoryClass=CustomerLinkRepository::class)
  14.  */
  15. class CustomerLink extends AbstractEntity
  16. {
  17.     /**
  18.      * @var Domain
  19.      *
  20.      * @ManyToOne(targetEntity="Customer", inversedBy="links")
  21.      * @JoinColumn(name="customer_id", referencedColumnName="id")
  22.      */
  23.     private $customer;
  24.     public const Type_Web = 1;
  25.     public const Type_Eshop = 2;
  26.     public const Type_Facebook = 3;
  27.     public const Type_GooglePlus = 4;
  28.     public const Type_Twitter = 5;
  29.     public static function getTypeChoices()
  30.     {
  31.         return [
  32.             self::Type_Web => 'web',
  33.             self::Type_Eshop => 'e-shop',
  34.             self::Type_Facebook => 'Facebook',
  35.             self::Type_GooglePlus => 'Google Plus',
  36.             self::Type_Twitter => 'Twitter',
  37.         ];
  38.     }
  39.     /**
  40.      * @var int
  41.      *
  42.      * @Column(name="type", type="integer")
  43.      */
  44.     private $type;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @Column(name="url", type="text")
  49.      */
  50.     private $url;
  51.     /**
  52.      * @return Customer
  53.      */
  54.     public function getCustomer()
  55.     {
  56.         return $this->customer;
  57.     }
  58.     /**
  59.      * @param Customer $customer
  60.      */
  61.     public function setCustomer($customer)
  62.     {
  63.         $this->customer = $customer;
  64.     }
  65.     /**
  66.      * Set type
  67.      *
  68.      * @param int $type
  69.      * @return CustomerLink
  70.      */
  71.     public function setType($type)
  72.     {
  73.         $this->type = $type;
  74.         return $this;
  75.     }
  76.     /**
  77.      * Get type
  78.      *
  79.      * @return int
  80.      */
  81.     public function getType()
  82.     {
  83.         return $this->type;
  84.     }
  85.     /**
  86.      * Set url
  87.      *
  88.      * @param string $url
  89.      * @return CustomerLink
  90.      */
  91.     public function setUrl($url)
  92.     {
  93.         $this->url = $url;
  94.         return $this;
  95.     }
  96.     /**
  97.      * Get url
  98.      *
  99.      * @return string
  100.      */
  101.     public function getUrl()
  102.     {
  103.         return $this->url;
  104.     }
  105. }