fetchInItem() public method

Get menu items by identifier list
public fetchInItem ( array $ids, array $with = [] ) : MenuItem[]
$ids array menu item identifier
$with array relation
return Xpressengine\Menu\Models\MenuItem[]
Example #1
0
 /**
  * Get menu items by identifier list
  *
  * @param array $ids  menu item identifier
  * @param array $with relation
  * @return MenuItem[]
  */
 public function fetchInItem(array $ids, $with = [])
 {
     $items = $this->repo->fetchInItem($ids, $with);
     foreach ($items as $item) {
         $this->bag[$item->getKey()] = $item;
     }
     return $items;
 }
Example #2
0
 /**
  * Get menu items by identifier list
  *
  * @param array $ids  menu item identifier
  * @param array $with relation
  * @return MenuItem[]
  */
 public function fetchInItem(array $ids, $with = [])
 {
     $items = $this->repo->fetchInItem($ids, $with);
     foreach ($items as $item) {
         $key = $this->getItemCacheKey($item->getKey());
         $this->cache->put($key, $item);
     }
     return $items;
 }
Example #3
0
 /**
  * Get menu item list by identifiers
  *
  * @param array $ids  menu item identifier list
  * @param array $with relation
  * @return MenuItem[]
  */
 public function getItemIn($ids, $with = [])
 {
     return $this->repo->fetchInItem((array) $ids, $with);
 }
 /**
  * Get menu items by identifier list
  *
  * @param array $ids  menu item identifier
  * @param array $with relation
  * @return MenuItem[]
  */
 public function fetchInItem(array $ids, $with = [])
 {
     return $this->repo->fetchInItem($ids, $with);
 }