src/Eccube/Entity/ClassName.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\ClassName')) {
  15.     /**
  16.      * ClassName
  17.      *
  18.      * @ORM\Table(name="dtb_class_name")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\ClassNameRepository")
  23.      */
  24.     class ClassName extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         /**
  27.          * @return string
  28.          */
  29.         public function __toString()
  30.         {
  31.             return $this->getName();
  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="backend_name", type="string", length=255, nullable=true)
  45.          */
  46.         private $backend_name;
  47.         /**
  48.          * @var string
  49.          *
  50.          * @ORM\Column(name="name", type="string", length=255)
  51.          */
  52.         private $name;
  53.         /**
  54.          * @var int
  55.          *
  56.          * @ORM\Column(name="sort_no", type="integer", options={"unsigned":true})
  57.          */
  58.         private $sort_no;
  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.          * @var \Doctrine\Common\Collections\Collection
  73.          *
  74.          * @ORM\OneToMany(targetEntity="Eccube\Entity\ClassCategory", mappedBy="ClassName")
  75.          * @ORM\OrderBy({
  76.          *     "sort_no"="DESC"
  77.          * })
  78.          */
  79.         private $ClassCategories;
  80.         /**
  81.          * @var \Eccube\Entity\Member
  82.          *
  83.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  84.          * @ORM\JoinColumns({
  85.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  86.          * })
  87.          */
  88.         private $Creator;
  89.         /**
  90.          * Constructor
  91.          */
  92.         public function __construct()
  93.         {
  94.             $this->ClassCategories = new \Doctrine\Common\Collections\ArrayCollection();
  95.         }
  96.         /**
  97.          * Get id.
  98.          *
  99.          * @return int
  100.          */
  101.         public function getId()
  102.         {
  103.             return $this->id;
  104.         }
  105.         /**
  106.          * Set backend_name.
  107.          *
  108.          * @param string $backendName
  109.          *
  110.          * @return ClassName
  111.          */
  112.         public function setBackendName($backendName)
  113.         {
  114.             $this->backend_name $backendName;
  115.             return $this;
  116.         }
  117.         /**
  118.          * Get backend_name.
  119.          *
  120.          * @return string
  121.          */
  122.         public function getBackendName()
  123.         {
  124.             return $this->backend_name;
  125.         }
  126.         /**
  127.          * Set name.
  128.          *
  129.          * @param string $name
  130.          *
  131.          * @return ClassName
  132.          */
  133.         public function setName($name)
  134.         {
  135.             $this->name $name;
  136.             return $this;
  137.         }
  138.         /**
  139.          * Get name.
  140.          *
  141.          * @return string
  142.          */
  143.         public function getName()
  144.         {
  145.             return $this->name;
  146.         }
  147.         /**
  148.          * Set sortNo.
  149.          *
  150.          * @param int $sortNo
  151.          *
  152.          * @return ClassName
  153.          */
  154.         public function setSortNo($sortNo)
  155.         {
  156.             $this->sort_no $sortNo;
  157.             return $this;
  158.         }
  159.         /**
  160.          * Get sortNo.
  161.          *
  162.          * @return int
  163.          */
  164.         public function getSortNo()
  165.         {
  166.             return $this->sort_no;
  167.         }
  168.         /**
  169.          * Set createDate.
  170.          *
  171.          * @param \DateTime $createDate
  172.          *
  173.          * @return ClassName
  174.          */
  175.         public function setCreateDate($createDate)
  176.         {
  177.             $this->create_date $createDate;
  178.             return $this;
  179.         }
  180.         /**
  181.          * Get createDate.
  182.          *
  183.          * @return \DateTime
  184.          */
  185.         public function getCreateDate()
  186.         {
  187.             return $this->create_date;
  188.         }
  189.         /**
  190.          * Set updateDate.
  191.          *
  192.          * @param \DateTime $updateDate
  193.          *
  194.          * @return ClassName
  195.          */
  196.         public function setUpdateDate($updateDate)
  197.         {
  198.             $this->update_date $updateDate;
  199.             return $this;
  200.         }
  201.         /**
  202.          * Get updateDate.
  203.          *
  204.          * @return \DateTime
  205.          */
  206.         public function getUpdateDate()
  207.         {
  208.             return $this->update_date;
  209.         }
  210.         /**
  211.          * Add classCategory.
  212.          *
  213.          * @param \Eccube\Entity\ClassCategory $classCategory
  214.          *
  215.          * @return ClassName
  216.          */
  217.         public function addClassCategory(ClassCategory $classCategory)
  218.         {
  219.             $this->ClassCategories[] = $classCategory;
  220.             return $this;
  221.         }
  222.         /**
  223.          * Remove classCategory.
  224.          *
  225.          * @param \Eccube\Entity\ClassCategory $classCategory
  226.          *
  227.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  228.          */
  229.         public function removeClassCategory(ClassCategory $classCategory)
  230.         {
  231.             return $this->ClassCategories->removeElement($classCategory);
  232.         }
  233.         /**
  234.          * Get classCategories.
  235.          *
  236.          * @return \Doctrine\Common\Collections\Collection
  237.          */
  238.         public function getClassCategories()
  239.         {
  240.             return $this->ClassCategories;
  241.         }
  242.         /**
  243.          * Set creator.
  244.          *
  245.          * @param \Eccube\Entity\Member|null $creator
  246.          *
  247.          * @return ClassName
  248.          */
  249.         public function setCreator(Member $creator null)
  250.         {
  251.             $this->Creator $creator;
  252.             return $this;
  253.         }
  254.         /**
  255.          * Get creator.
  256.          *
  257.          * @return \Eccube\Entity\Member|null
  258.          */
  259.         public function getCreator()
  260.         {
  261.             return $this->Creator;
  262.         }
  263.     }
  264. }