src/Eccube/Entity/Template.php line 18

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\Template')) {
  15.     /**
  16.      * Template
  17.      *
  18.      * @ORM\Table(name="dtb_template")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\TemplateRepository")
  23.      */
  24.     class Template extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         /**
  27.          *  初期テンプレートコード
  28.          */
  29.         public const DEFAULT_TEMPLATE_CODE 'default';
  30.         /**
  31.          * @return bool
  32.          */
  33.         public function isDefaultTemplate()
  34.         {
  35.             return self::DEFAULT_TEMPLATE_CODE === $this->getCode();
  36.         }
  37.         /**
  38.          * @return string
  39.          */
  40.         public function __toString()
  41.         {
  42.             return (string) $this->getName();
  43.         }
  44.         /**
  45.          * @var int
  46.          *
  47.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  48.          * @ORM\Id
  49.          * @ORM\GeneratedValue(strategy="IDENTITY")
  50.          */
  51.         private $id;
  52.         /**
  53.          * @var string
  54.          *
  55.          * @ORM\Column(name="template_code", type="string", length=255)
  56.          */
  57.         private $code;
  58.         /**
  59.          * @var string
  60.          *
  61.          * @ORM\Column(name="template_name", type="string", length=255)
  62.          */
  63.         private $name;
  64.         /**
  65.          * @var \DateTime
  66.          *
  67.          * @ORM\Column(name="create_date", type="datetimetz")
  68.          */
  69.         private $create_date;
  70.         /**
  71.          * @var \DateTime
  72.          *
  73.          * @ORM\Column(name="update_date", type="datetimetz")
  74.          */
  75.         private $update_date;
  76.         /**
  77.          * @var \Eccube\Entity\Master\DeviceType
  78.          *
  79.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType")
  80.          * @ORM\JoinColumns({
  81.          *   @ORM\JoinColumn(name="device_type_id", referencedColumnName="id")
  82.          * })
  83.          */
  84.         private $DeviceType;
  85.         /**
  86.          * Get id.
  87.          *
  88.          * @return int
  89.          */
  90.         public function getId()
  91.         {
  92.             return $this->id;
  93.         }
  94.         /**
  95.          * Set code.
  96.          *
  97.          * @param string $code
  98.          *
  99.          * @return Template
  100.          */
  101.         public function setCode($code)
  102.         {
  103.             $this->code $code;
  104.             return $this;
  105.         }
  106.         /**
  107.          * Get code.
  108.          *
  109.          * @return string
  110.          */
  111.         public function getCode()
  112.         {
  113.             return $this->code;
  114.         }
  115.         /**
  116.          * Set name.
  117.          *
  118.          * @param string $name
  119.          *
  120.          * @return Template
  121.          */
  122.         public function setName($name)
  123.         {
  124.             $this->name $name;
  125.             return $this;
  126.         }
  127.         /**
  128.          * Get name.
  129.          *
  130.          * @return string
  131.          */
  132.         public function getName()
  133.         {
  134.             return $this->name;
  135.         }
  136.         /**
  137.          * Set createDate.
  138.          *
  139.          * @param \DateTime $createDate
  140.          *
  141.          * @return Template
  142.          */
  143.         public function setCreateDate($createDate)
  144.         {
  145.             $this->create_date $createDate;
  146.             return $this;
  147.         }
  148.         /**
  149.          * Get createDate.
  150.          *
  151.          * @return \DateTime
  152.          */
  153.         public function getCreateDate()
  154.         {
  155.             return $this->create_date;
  156.         }
  157.         /**
  158.          * Set updateDate.
  159.          *
  160.          * @param \DateTime $updateDate
  161.          *
  162.          * @return Template
  163.          */
  164.         public function setUpdateDate($updateDate)
  165.         {
  166.             $this->update_date $updateDate;
  167.             return $this;
  168.         }
  169.         /**
  170.          * Get updateDate.
  171.          *
  172.          * @return \DateTime
  173.          */
  174.         public function getUpdateDate()
  175.         {
  176.             return $this->update_date;
  177.         }
  178.         /**
  179.          * Set deviceType.
  180.          *
  181.          * @param \Eccube\Entity\Master\DeviceType|null $deviceType
  182.          *
  183.          * @return Template
  184.          */
  185.         public function setDeviceType(Master\DeviceType $deviceType null)
  186.         {
  187.             $this->DeviceType $deviceType;
  188.             return $this;
  189.         }
  190.         /**
  191.          * Get deviceType.
  192.          *
  193.          * @return \Eccube\Entity\Master\DeviceType|null
  194.          */
  195.         public function getDeviceType()
  196.         {
  197.             return $this->DeviceType;
  198.         }
  199.     }
  200. }