src/Eccube/Entity/Calendar.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\Calendar')) {
  15.     /**
  16.      * Calendar
  17.      *
  18.      * @ORM\Table(name="dtb_calendar")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\CalendarRepository")
  23.      */
  24.     class Calendar extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         /**
  27.          * @var int
  28.          */
  29.         public const DEFAULT_CALENDAR_ID 1;
  30.         /**
  31.          * is default
  32.          *
  33.          * @return bool
  34.          */
  35.         public function isDefaultCalendar()
  36.         {
  37.             return self::DEFAULT_CALENDAR_ID === $this->getId();
  38.         }
  39.         /**
  40.          * @var int
  41.          *
  42.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  43.          * @ORM\Id
  44.          * @ORM\GeneratedValue(strategy="IDENTITY")
  45.          */
  46.         private $id;
  47.         /**
  48.          * @var string
  49.          *
  50.          * @ORM\Column(name="title", type="string", length=255, nullable=true)
  51.          */
  52.         private $title;
  53.         /**
  54.          * @var \DateTime
  55.          *
  56.          * @ORM\Column(name="holiday", type="datetimetz")
  57.          */
  58.         private $holiday;
  59.         /**
  60.          * @var \DateTime
  61.          *
  62.          * @ORM\Column(name="create_date", type="datetimetz")
  63.          */
  64.         private $create_date;
  65.         /**
  66.          * @var \DateTime
  67.          *
  68.          * @ORM\Column(name="update_date", type="datetimetz")
  69.          */
  70.         private $update_date;
  71.         /**
  72.          * Get id.
  73.          *
  74.          * @return int
  75.          */
  76.         public function getId()
  77.         {
  78.             return $this->id;
  79.         }
  80.         /**
  81.          * Set title.
  82.          *
  83.          * @param string $title
  84.          *
  85.          * @return Calendar
  86.          */
  87.         public function setTitle($title)
  88.         {
  89.             $this->title $title;
  90.             return $this;
  91.         }
  92.         /**
  93.          * Get title.
  94.          *
  95.          * @return string
  96.          */
  97.         public function getTitle()
  98.         {
  99.             return $this->title;
  100.         }
  101.         /**
  102.          * Set holiday.
  103.          *
  104.          * @param \DateTime $holiday
  105.          *
  106.          * @return Calendar
  107.          */
  108.         public function setHoliday($holiday)
  109.         {
  110.             $this->holiday $holiday;
  111.             return $this;
  112.         }
  113.         /**
  114.          * Get holiday.
  115.          *
  116.          * @return \DateTime
  117.          */
  118.         public function getHoliday()
  119.         {
  120.             return $this->holiday;
  121.         }
  122.         /**
  123.          * Set createDate.
  124.          *
  125.          * @param \DateTime $createDate
  126.          *
  127.          * @return Calendar
  128.          */
  129.         public function setCreateDate($createDate)
  130.         {
  131.             $this->create_date $createDate;
  132.             return $this;
  133.         }
  134.         /**
  135.          * Get createDate.
  136.          *
  137.          * @return \DateTime
  138.          */
  139.         public function getCreateDate()
  140.         {
  141.             return $this->create_date;
  142.         }
  143.         /**
  144.          * Set updateDate.
  145.          *
  146.          * @param \DateTime $updateDate
  147.          *
  148.          * @return Calendar
  149.          */
  150.         public function setUpdateDate($updateDate)
  151.         {
  152.             $this->update_date $updateDate;
  153.             return $this;
  154.         }
  155.         /**
  156.          * Get updateDate.
  157.          *
  158.          * @return \DateTime
  159.          */
  160.         public function getUpdateDate()
  161.         {
  162.             return $this->update_date;
  163.         }
  164.     }
  165. }