app/proxy/entity/app/Plugin/Maker42/Entity/Maker.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 Plugin\Maker42\Entity;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Eccube\Entity\AbstractEntity;
  15. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  16. use Symfony\Component\Validator\Mapping\ClassMetadata;
  17. /**
  18.  * Class Maker.
  19.  *
  20.  * @ORM\Table(name="plg_maker")
  21.  * @ORM\Entity(repositoryClass="Plugin\Maker42\Repository\MakerRepository")
  22.  */
  23. class Maker extends AbstractEntity
  24. {
  25.     use \Customize\Entity\MakerTrait;
  26.     /**
  27.      * @var int
  28.      *
  29.      * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue(strategy="IDENTITY")
  32.      */
  33.     private $id;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="name", type="string", length=255)
  38.      */
  39.     private $name;
  40.     /**
  41.      * @var int
  42.      *
  43.      * @ORM\Column(name="sort_no", type="integer")
  44.      */
  45.     private $sort_no;
  46.     /**
  47.      * @var \DateTime
  48.      *
  49.      * @ORM\Column(name="create_date", type="datetimetz")
  50.      */
  51.     private $create_date;
  52.     /**
  53.      * @var \DateTime
  54.      *
  55.      * @ORM\Column(name="update_date", type="datetimetz")
  56.      */
  57.     private $update_date;
  58.     /**
  59.      * Get id.
  60.      *
  61.      * @return int
  62.      */
  63.     public function getId()
  64.     {
  65.         return $this->id;
  66.     }
  67.     /**
  68.      * Get name.
  69.      *
  70.      * @return string
  71.      */
  72.     public function getName()
  73.     {
  74.         return $this->name;
  75.     }
  76.     /**
  77.      * Set name.
  78.      *
  79.      * @param string $name
  80.      *
  81.      * @return Maker
  82.      */
  83.     public function setName($name)
  84.     {
  85.         $this->name $name;
  86.         return $this;
  87.     }
  88.     /**
  89.      * Get sort_no.
  90.      *
  91.      * @return int
  92.      */
  93.     public function getSortNo()
  94.     {
  95.         return $this->sort_no;
  96.     }
  97.     /**
  98.      * Set sort no.
  99.      *
  100.      * @param int $sortNo
  101.      *
  102.      * @return Maker
  103.      */
  104.     public function setSortNo($sortNo)
  105.     {
  106.         $this->sort_no $sortNo;
  107.         return $this;
  108.     }
  109.     /**
  110.      * Set create_date.
  111.      *
  112.      * @param \DateTime $createDate
  113.      *
  114.      * @return Maker
  115.      */
  116.     public function setCreateDate($createDate)
  117.     {
  118.         $this->create_date $createDate;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get create_date.
  123.      *
  124.      * @return \DateTime
  125.      */
  126.     public function getCreateDate()
  127.     {
  128.         return $this->create_date;
  129.     }
  130.     /**
  131.      * Set update_date.
  132.      *
  133.      * @param \DateTime $updateDate
  134.      *
  135.      * @return Maker
  136.      */
  137.     public function setUpdateDate($updateDate)
  138.     {
  139.         $this->update_date $updateDate;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get update_date.
  144.      *
  145.      * @return \DateTime
  146.      */
  147.     public function getUpdateDate()
  148.     {
  149.         return $this->update_date;
  150.     }
  151.     /**
  152.      * Unique check.
  153.      *
  154.      * @param ClassMetadata $metadata
  155.      */
  156.     public static function loadValidatorMetadata(ClassMetadata $metadata)
  157.     {
  158.         $metadata->addConstraint(new UniqueEntity([
  159.             'fields' => 'name',
  160.         ]));
  161.     }
  162. }