src/Eccube/Entity/PageLayout.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\PageLayout')) {
  15.     /**
  16.      * PageLayout
  17.      *
  18.      * @ORM\Table(name="dtb_page_layout")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\PageLayoutRepository")
  23.      */
  24.     class PageLayout extends AbstractEntity
  25.     {
  26.         /**
  27.          * @var integer
  28.          *
  29.          * @ORM\Column(name="page_id", type="integer", options={"unsigned":true})
  30.          * @ORM\Id
  31.          * @ORM\GeneratedValue(strategy="NONE")
  32.          */
  33.         private $page_id;
  34.         /**
  35.          * @var integer
  36.          *
  37.          * @ORM\Column(name="layout_id", type="integer", options={"unsigned":true})
  38.          * @ORM\Id
  39.          * @ORM\GeneratedValue(strategy="NONE")
  40.          */
  41.         private $layout_id;
  42.         /**
  43.          * @var int
  44.          *
  45.          * @ORM\Column(name="sort_no", type="smallint", options={"unsigned":true})
  46.          */
  47.         private $sort_no;
  48.         /**
  49.          * @var \Eccube\Entity\Page
  50.          *
  51.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Page", inversedBy="PageLayouts")
  52.          * @ORM\JoinColumns({
  53.          *   @ORM\JoinColumn(name="page_id", referencedColumnName="id")
  54.          * })
  55.          */
  56.         private $Page;
  57.         /**
  58.          * @var \Eccube\Entity\Layout
  59.          *
  60.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Layout", inversedBy="PageLayouts")
  61.          * @ORM\JoinColumns({
  62.          *   @ORM\JoinColumn(name="layout_id", referencedColumnName="id")
  63.          * })
  64.          */
  65.         private $Layout;
  66.         /**
  67.          * Set pageId
  68.          *
  69.          * @param integer $pageId
  70.          *
  71.          * @return PageLayout
  72.          */
  73.         public function setPageId($pageId)
  74.         {
  75.             $this->page_id $pageId;
  76.             return $this;
  77.         }
  78.         /**
  79.          * Get pageId
  80.          *
  81.          * @return integer
  82.          */
  83.         public function getPageId()
  84.         {
  85.             return $this->page_id;
  86.         }
  87.         /**
  88.          * Set layoutId
  89.          *
  90.          * @param integer $layoutId
  91.          *
  92.          * @return PageLayout
  93.          */
  94.         public function setLayoutId($layoutId)
  95.         {
  96.             $this->layout_id $layoutId;
  97.             return $this;
  98.         }
  99.         /**
  100.          * Get layoutId
  101.          *
  102.          * @return integer
  103.          */
  104.         public function getLayoutId()
  105.         {
  106.             return $this->layout_id;
  107.         }
  108.         /**
  109.          * Set sort_no
  110.          *
  111.          * @param int $sortNo
  112.          *
  113.          * @return PageLayout
  114.          */
  115.         public function setSortNo($sortNo)
  116.         {
  117.             $this->sort_no $sortNo;
  118.             return $this;
  119.         }
  120.         /**
  121.          * Get sort_no
  122.          *
  123.          * @return int
  124.          */
  125.         public function getSortNo()
  126.         {
  127.             return $this->sort_no;
  128.         }
  129.         /**
  130.          * Set pageLayout
  131.          *
  132.          * @param \Eccube\Entity\Page $Page
  133.          *
  134.          * @return PageLayout
  135.          */
  136.         public function setPage(Page $Page null)
  137.         {
  138.             $this->Page $Page;
  139.             return $this;
  140.         }
  141.         /**
  142.          * Get pageLayout
  143.          *
  144.          * @return Page
  145.          */
  146.         public function getPage()
  147.         {
  148.             return $this->Page;
  149.         }
  150.         /**
  151.          * Set layout
  152.          *
  153.          * @param \Eccube\Entity\Layout $layout
  154.          *
  155.          * @return PageLayout
  156.          */
  157.         public function setLayout(Layout $layout null)
  158.         {
  159.             $this->Layout $layout;
  160.             return $this;
  161.         }
  162.         /**
  163.          * Get layout
  164.          *
  165.          * @return \Eccube\Entity\Layout
  166.          */
  167.         public function getLayout()
  168.         {
  169.             return $this->Layout;
  170.         }
  171.         /**
  172.          * DeviceTypeがあればDeviceTypeIdを返す
  173.          * DeviceTypeがなければnullを返す
  174.          *
  175.          * @return int|null
  176.          */
  177.         public function getDeviceTypeId()
  178.         {
  179.             if ($this->Layout->getDeviceType()) {
  180.                 return $this->Layout->getDeviceType()->getId();
  181.             }
  182.             return null;
  183.         }
  184.     }
  185. }