vendor/score/cms/src/Entity/Menu.php line 12

Open in your IDE?
  1. <?php
  2. namespace Score\CmsBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Score\BaseBundle\Entity\BaseEntity;
  5. /**
  6.  * @ORM\Entity
  7.  * @ORM\Table(name="cms_menu")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class Menu  extends BaseEntity {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\Column(type="integer")
  14.      * @ORM\GeneratedValue(strategy="AUTO")
  15.      */
  16.     protected $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=200)
  19.      */
  20.     protected $name;
  21.     /**
  22.      * @ORM\Column(type="string", length=1000 , nullable = true)
  23.      */
  24.     protected $link;
  25.     /**
  26.      * @ORM\Column(type="integer", nullable = true)
  27.      */
  28.     protected $parentId;
  29.     /**
  30.      * @ORM\Column(type="integer", nullable = true)
  31.      */
  32.     protected $lvl;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable = true)
  35.      */
  36.     protected $sortOrder;
  37.     /**
  38.      * @ORM\Column(type="string", nullable = true)
  39.      */
  40.     protected $lang;
  41.     /**
  42.      * @ORM\Column(type="integer", nullable = true)
  43.      */
  44.     protected $rootId;
  45.     /**
  46.      * @ORM\Column(type="string", nullable = true)
  47.      */
  48.     protected $linkType;
  49.     /**
  50.      * @ORM\Column(type="string", nullable = true)
  51.      */
  52.     protected $linkTypeData;
  53.      /**
  54.      * @ORM\OneToMany(targetEntity="\Score\CmsBundle\Entity\Multisite\SiteItemMenu", mappedBy="menu",cascade={"persist","remove"})
  55.      */
  56.     private $siteItemMenu = [];
  57.     private $multisite;
  58.     public function getId()
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getName()
  63.     {
  64.         return $this->name;
  65.     }
  66.     public function getLink()
  67.     {
  68.         return $this->link;
  69.     }
  70.     public function getParentId()
  71.     {
  72.         return $this->parentId;
  73.     }
  74.     public function getLvl()
  75.     {
  76.         return $this->lvl;
  77.     }
  78.     public function getSortOrder()
  79.     {
  80.         return $this->sortOrder;
  81.     }
  82.     public function getLang()
  83.     {
  84.         return $this->lang;
  85.     }
  86.     public function setId($id)
  87.     {
  88.         $this->id $id;
  89.     }
  90.     public function setName($name)
  91.     {
  92.         $this->name $name;
  93.     }
  94.     public function setLink($link)
  95.     {
  96.         $this->link $link;
  97.     }
  98.     public function setParentId($parentId)
  99.     {
  100.         $this->parentId $parentId;
  101.     }
  102.     public function setLvl($lvl)
  103.     {
  104.         $this->lvl $lvl;
  105.     }
  106.     public function setSortOrder($sortOrder)
  107.     {
  108.         $this->sortOrder $sortOrder;
  109.     }
  110.     public function setLang($lang)
  111.     {
  112.         $this->lang $lang;
  113.     }
  114.     public function getRootId()
  115.     {
  116.         return $this->rootId;
  117.     }
  118.     public function setRootId($rootId)
  119.     {
  120.         $this->rootId $rootId;
  121.     }
  122.     public function getLinkType()
  123.     {
  124.         return $this->linkType;
  125.     }
  126.     public function getLinkTypeData()
  127.     {
  128.         return $this->linkTypeData;
  129.     }
  130.     public function setLinkType($linkType)
  131.     {
  132.         $this->linkType $linkType;
  133.     }
  134.     public function setLinkTypeData($linkTypeData)
  135.     {
  136.         $this->linkTypeData $linkTypeData;
  137.     }
  138.     public function getLinkTypeId()
  139.     {
  140.         if ('page' == $this->getLinkType())
  141.         {
  142.             $data json_decode($this->getLinkTypeData(),true);
  143.             return $data['id'];
  144.         }
  145.         else
  146.         {
  147.             return null;
  148.         }
  149.     }
  150.     public function getPublicLink()
  151.     {
  152.         if ('page' == $this->getLinkType())
  153.         {
  154.             //return  $this->getLink();
  155.             $routeInfo json_decode($this->getLinkTypeData(),true);
  156.             return $routeInfo['seoId'];
  157.         }
  158.         else
  159.         {
  160.             return $this->getLink();
  161.         }
  162.     }
  163.     /**
  164.      * Get the value of siteItemMenu
  165.      */ 
  166.     public function getSiteItemMenu()
  167.     {
  168.         return $this->siteItemMenu;
  169.     }
  170.     /**
  171.      * Set the value of siteItemMenu
  172.      *
  173.      * @return  self
  174.      */ 
  175.     public function setSiteItemMenu($siteItemMenu)
  176.     {
  177.         $this->siteItemMenu $siteItemMenu;
  178.         return $this;
  179.     }
  180. }