src/Eccube/Entity/ProductImage.php line 28

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 Eccube\Entity;
  13. use Doctrine\ORM\Mapping as ORM;
  14. if (!class_exists('\Eccube\Entity\ProductImage')) {
  15.     /**
  16.      * ProductImage
  17.      *
  18.      * @ORM\Table(name="dtb_product_image")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\ProductImageRepository")
  23.      */
  24.     class ProductImage extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         /**
  27.          * @return string
  28.          */
  29.         public function __toString()
  30.         {
  31.             return (string) $this->getFileName();
  32.         }
  33.         /**
  34.          * @var int
  35.          *
  36.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  37.          * @ORM\Id
  38.          * @ORM\GeneratedValue(strategy="IDENTITY")
  39.          */
  40.         private $id;
  41.         /**
  42.          * @var string
  43.          *
  44.          * @ORM\Column(name="file_name", type="string", length=255)
  45.          */
  46.         private $file_name;
  47.         /**
  48.          * @var int
  49.          *
  50.          * @ORM\Column(name="sort_no", type="smallint", options={"unsigned":true})
  51.          */
  52.         private $sort_no;
  53.         /**
  54.          * @var \DateTime
  55.          *
  56.          * @ORM\Column(name="create_date", type="datetimetz")
  57.          */
  58.         private $create_date;
  59.         /**
  60.          * @var \Eccube\Entity\Product
  61.          *
  62.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Product", inversedBy="ProductImage")
  63.          * @ORM\JoinColumns({
  64.          *   @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  65.          * })
  66.          */
  67.         private $Product;
  68.         /**
  69.          * @var \Eccube\Entity\Member
  70.          *
  71.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  72.          * @ORM\JoinColumns({
  73.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  74.          * })
  75.          */
  76.         private $Creator;
  77.         /**
  78.          * Get id.
  79.          *
  80.          * @return int
  81.          */
  82.         public function getId()
  83.         {
  84.             return $this->id;
  85.         }
  86.         /**
  87.          * Set fileName.
  88.          *
  89.          * @param string $fileName
  90.          *
  91.          * @return ProductImage
  92.          */
  93.         public function setFileName($fileName)
  94.         {
  95.             $this->file_name $fileName;
  96.             return $this;
  97.         }
  98.         /**
  99.          * Get fileName.
  100.          *
  101.          * @return string
  102.          */
  103.         public function getFileName()
  104.         {
  105.             return $this->file_name;
  106.         }
  107.         /**
  108.          * Set sortNo.
  109.          *
  110.          * @param int $sortNo
  111.          *
  112.          * @return ProductImage
  113.          */
  114.         public function setSortNo($sortNo)
  115.         {
  116.             $this->sort_no $sortNo;
  117.             return $this;
  118.         }
  119.         /**
  120.          * Get sortNo.
  121.          *
  122.          * @return int
  123.          */
  124.         public function getSortNo()
  125.         {
  126.             return $this->sort_no;
  127.         }
  128.         /**
  129.          * Set createDate.
  130.          *
  131.          * @param \DateTime $createDate
  132.          *
  133.          * @return ProductImage
  134.          */
  135.         public function setCreateDate($createDate)
  136.         {
  137.             $this->create_date $createDate;
  138.             return $this;
  139.         }
  140.         /**
  141.          * Get createDate.
  142.          *
  143.          * @return \DateTime
  144.          */
  145.         public function getCreateDate()
  146.         {
  147.             return $this->create_date;
  148.         }
  149.         /**
  150.          * Set product.
  151.          *
  152.          * @param \Eccube\Entity\Product|null $product
  153.          *
  154.          * @return ProductImage
  155.          */
  156.         public function setProduct(Product $product null)
  157.         {
  158.             $this->Product $product;
  159.             return $this;
  160.         }
  161.         /**
  162.          * Get product.
  163.          *
  164.          * @return \Eccube\Entity\Product|null
  165.          */
  166.         public function getProduct()
  167.         {
  168.             return $this->Product;
  169.         }
  170.         /**
  171.          * Set creator.
  172.          *
  173.          * @param \Eccube\Entity\Member|null $creator
  174.          *
  175.          * @return ProductImage
  176.          */
  177.         public function setCreator(Member $creator null)
  178.         {
  179.             $this->Creator $creator;
  180.             return $this;
  181.         }
  182.         /**
  183.          * Get creator.
  184.          *
  185.          * @return \Eccube\Entity\Member|null
  186.          */
  187.         public function getCreator()
  188.         {
  189.             return $this->Creator;
  190.         }
  191.     }
  192. }