app/Customize/Entity/ProductGenre.php line 29

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Entity;
  13. use Customize\Entity\Master\Genre;
  14. use Doctrine\ORM\Mapping as ORM;
  15. if (!class_exists('\Eccube\Entity\ProductGenre')) {
  16.     /**
  17.      * ProductGenre
  18.      *
  19.      * @ORM\Table(name="dtb_product_genre")
  20.      * @ORM\InheritanceType("SINGLE_TABLE")
  21.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  22.      * @ORM\HasLifecycleCallbacks()
  23.      * @ORM\Entity(repositoryClass="Customize\Repository\ProductGenreRepository")
  24.      */
  25.     class ProductGenre extends \Eccube\Entity\AbstractEntity
  26.     {
  27.         /**
  28.          * @var int
  29.          *
  30.          * @ORM\Column(name="product_id", type="integer", options={"unsigned":true})
  31.          * @ORM\Id
  32.          * @ORM\GeneratedValue(strategy="NONE")
  33.          */
  34.         private $product_id;
  35.         /**
  36.          * @var int
  37.          *
  38.          * @ORM\Column(name="genre_id", type="smallint", options={"unsigned":true})
  39.          * @ORM\Id
  40.          * @ORM\GeneratedValue(strategy="NONE")
  41.          */
  42.         private $genre_id;
  43.         /**
  44.          * @var \Eccube\Entity\Product
  45.          *
  46.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Product", inversedBy="ProductGenres")
  47.          * @ORM\JoinColumns({
  48.          *   @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  49.          * })
  50.          */
  51.         private $Product;
  52.         /**
  53.          * @var \Customize\Entity\Master\Genre
  54.          *
  55.          * @ORM\ManyToOne(targetEntity="Customize\Entity\Master\Genre")
  56.          * @ORM\JoinColumns({
  57.          *   @ORM\JoinColumn(name="genre_id", referencedColumnName="id")
  58.          * })
  59.          */
  60.         private $Genre;
  61.         /**
  62.          * Set productId.
  63.          *
  64.          * @param int $productId
  65.          *
  66.          * @return ProductGenre
  67.          */
  68.         public function setProductId($productId)
  69.         {
  70.             $this->product_id $productId;
  71.             return $this;
  72.         }
  73.         /**
  74.          * Get productId.
  75.          *
  76.          * @return int
  77.          */
  78.         public function getProductId()
  79.         {
  80.             return $this->product_id;
  81.         }
  82.         /**
  83.          * Set genreId.
  84.          *
  85.          * @param int $genreId
  86.          *
  87.          * @return ProductGenre
  88.          */
  89.         public function setGenreId($genreId)
  90.         {
  91.             $this->genre_id $genreId;
  92.             return $this;
  93.         }
  94.         /**
  95.          * Get genreId.
  96.          *
  97.          * @return int
  98.          */
  99.         public function getGenreId()
  100.         {
  101.             return $this->genre_id;
  102.         }
  103.         /**
  104.          * Set product.
  105.          *
  106.          * @param \Eccube\Entity\Product|null $product
  107.          *
  108.          * @return ProductGenre
  109.          */
  110.         public function setProduct(\Eccube\Entity\Product $product null)
  111.         {
  112.             $this->Product $product;
  113.             return $this;
  114.         }
  115.         /**
  116.          * Get product.
  117.          *
  118.          * @return \Eccube\Entity\Product|null
  119.          */
  120.         public function getProduct()
  121.         {
  122.             return $this->Product;
  123.         }
  124.         /**
  125.          * Set Genre.
  126.          *
  127.          * @param \Customize\Entity\Master\Genre|null $genre
  128.          *
  129.          * @return ProductGenre
  130.          */
  131.         public function setGenre(Genre $genre null)
  132.         {
  133.             $this->Genre $genre;
  134.             return $this;
  135.         }
  136.         /**
  137.          * Get genre.
  138.          *
  139.          * @return \Customize\Entity\Master\Genre|null
  140.          */
  141.         public function getGenre()
  142.         {
  143.             return $this->Genre;
  144.         }
  145.     }
  146. }