insert() public method

Insert menu
public insert ( Menu $menu ) : Menu
$menu Xpressengine\Menu\Models\Menu menu instance
return Xpressengine\Menu\Models\Menu
示例#1
0
 /**
  * Insert menu
  *
  * @param Menu $menu menu instance
  * @return Menu
  */
 public function insert(Menu $menu)
 {
     $menu = $this->repo->insert($menu);
     $key = $this->getCacheKey($menu->getKey());
     $this->cache->put($key, $menu);
     return $menu;
 }
示例#2
0
 /**
  * Create new menu
  *
  * @param array $inputs attributes
  * @return Menu
  */
 public function create(array $inputs)
 {
     $menu = $this->repo->createModel();
     $menu->fill($inputs);
     return $this->repo->insert($menu);
 }
 /**
  * Insert menu
  *
  * @param Menu $menu menu instance
  * @return Menu
  */
 public function insert(Menu $menu)
 {
     $this->cache->forget($this->getCacheKey($menu->siteKey . '_all'));
     return $this->repo->insert($menu);
 }
示例#4
0
 /**
  * Insert menu
  *
  * @param Menu $menu menu instance
  * @return Menu
  */
 public function insert(Menu $menu)
 {
     $menu = $this->repo->insert($menu);
     $this->bag[$menu->getKey()] = $menu;
     return $menu;
 }
 /**
  * Insert menu
  *
  * @param Menu $menu menu instance
  * @return Menu
  */
 public function insert(Menu $menu)
 {
     return $this->repo->insert($menu);
 }