<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Customize\Entity;
use Customize\Entity\Master\Genre;
use Doctrine\ORM\Mapping as ORM;
if (!class_exists('\Eccube\Entity\ProductGenre')) {
/**
* ProductGenre
*
* @ORM\Table(name="dtb_product_genre")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
* @ORM\HasLifecycleCallbacks()
* @ORM\Entity(repositoryClass="Customize\Repository\ProductGenreRepository")
*/
class ProductGenre extends \Eccube\Entity\AbstractEntity
{
/**
* @var int
*
* @ORM\Column(name="product_id", type="integer", options={"unsigned":true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $product_id;
/**
* @var int
*
* @ORM\Column(name="genre_id", type="smallint", options={"unsigned":true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $genre_id;
/**
* @var \Eccube\Entity\Product
*
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Product", inversedBy="ProductGenres")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="product_id", referencedColumnName="id")
* })
*/
private $Product;
/**
* @var \Customize\Entity\Master\Genre
*
* @ORM\ManyToOne(targetEntity="Customize\Entity\Master\Genre")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="genre_id", referencedColumnName="id")
* })
*/
private $Genre;
/**
* Set productId.
*
* @param int $productId
*
* @return ProductGenre
*/
public function setProductId($productId)
{
$this->product_id = $productId;
return $this;
}
/**
* Get productId.
*
* @return int
*/
public function getProductId()
{
return $this->product_id;
}
/**
* Set genreId.
*
* @param int $genreId
*
* @return ProductGenre
*/
public function setGenreId($genreId)
{
$this->genre_id = $genreId;
return $this;
}
/**
* Get genreId.
*
* @return int
*/
public function getGenreId()
{
return $this->genre_id;
}
/**
* Set product.
*
* @param \Eccube\Entity\Product|null $product
*
* @return ProductGenre
*/
public function setProduct(\Eccube\Entity\Product $product = null)
{
$this->Product = $product;
return $this;
}
/**
* Get product.
*
* @return \Eccube\Entity\Product|null
*/
public function getProduct()
{
return $this->Product;
}
/**
* Set Genre.
*
* @param \Customize\Entity\Master\Genre|null $genre
*
* @return ProductGenre
*/
public function setGenre(Genre $genre = null)
{
$this->Genre = $genre;
return $this;
}
/**
* Get genre.
*
* @return \Customize\Entity\Master\Genre|null
*/
public function getGenre()
{
return $this->Genre;
}
}
}