src/AtechNet/CoreBundle/Entity/ProductExternalFeedName.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\Entity;
  5. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\ManyToOne;
  8. use Doctrine\ORM\Mapping\Table as Table;
  9. use Doctrine\ORM\Mapping\UniqueConstraint;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * ProductExternalFeedName
  13.  *
  14.  * @Entity
  15.  * @Table(name="product_external_feed_names", uniqueConstraints={
  16.  *     @UniqueConstraint(name="unique_product_language", columns={"language_id", "product_id"})
  17.  * })
  18.  * @HasLifecycleCallbacks
  19.  */
  20. class ProductExternalFeedName extends AbstractEntity
  21. {
  22.     /**
  23.      * @ManyToOne(targetEntity="Product", inversedBy="externalFeedNames")
  24.      * @JoinColumn(name="product_id", referencedColumnName="id")
  25.      **/
  26.     private $product;
  27.     /**
  28.      * @var Language
  29.      *
  30.      * @ManyToOne(targetEntity="Language")
  31.      * @JoinColumn(name="language_id", referencedColumnName="id")
  32.      */
  33.     private $language;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @Assert\NotNull
  38.      *
  39.      * @Column(name="name", type="text")
  40.      *
  41.      **/
  42.     private $name;
  43.     public function __construct()
  44.     {
  45.         parent::__construct();
  46.     }
  47.     /**
  48.      * @return Product
  49.      */
  50.     public function getProduct(): Product
  51.     {
  52.         return $this->product;
  53.     }
  54.     /**
  55.      * @param Product $product
  56.      */
  57.     public function setProduct(Product $product)
  58.     {
  59.         $this->product = $product;
  60.     }
  61.     /**
  62.      * @return Language
  63.      */
  64.     public function getLanguage(): Language
  65.     {
  66.         return $this->language;
  67.     }
  68.     /**
  69.      * @param Language $language
  70.      */
  71.     public function setLanguage(Language $language)
  72.     {
  73.         $this->language = $language;
  74.     }
  75.     /**
  76.      * @return string
  77.      */
  78.     public function getName(): string
  79.     {
  80.         return $this->name;
  81.     }
  82.     /**
  83.      * @param string $name
  84.      */
  85.     public function setName(string $name)
  86.     {
  87.         $this->name = $name;
  88.     }
  89. }