Ejemplo n.º 1
0
 /**
  * testMenuGetRawItems
  *
  * @return void
  */
 public function testMenuGetRawItems()
 {
     $treeCollection = $this->getTreeCollection();
     $menu = new MenuEntity(['id' => 'main', 'title' => '기본메뉴', 'description' => '기본메뉴입니다.'], $treeCollection);
     $items = $menu->getRawItems();
     $this->assertEquals(4, count($items));
 }
 /**
  * forgetMenuMap
  *
  * @param MenuEntity $menu to forget keys menu map menu object
  *
  * @return void
  */
 public function forgetMenuMap(MenuEntity $menu)
 {
     $itemKeys = array_keys($menu->getRawItems());
     if ($this->cache->has($this->menuMapKey)) {
         /**
          * @var $menuMap array
          */
         $menuMap = $this->cache->get($this->menuMapKey);
         $menuMap = array_except($menuMap, $itemKeys);
     } else {
         $menuMap = [];
     }
     $this->cache->forever($this->menuMapKey, $menuMap);
 }