Add child to Item

@param array $items

@return bool
355002
public function addChildren(array $items): bool
    {
        if ($this->_item) {
            foreach ($items as $name) {
                $child = $this->manager->getPermission($name);
                if (empty($child) && $this->type == Item::TYPE_ROLE) {
                    $child = $this->manager->getRole($name);
                }
                $this->manager->addChild($this->_item, $child);
            }
        }

        return true;
    }
1058453
public function items(array $items)
    {
        foreach ($items as $uri => $title) {
            list($title, $uri, $liAttr) = $this->fixData($uri, $title);
            $this->item($title, $uri, $liAttr);
        }
        return $this;
    }
535840
public function foreverMany(array $items)
    {
        if (! method_exists($this->store, 'foreverMany')) {
            array_map([$this, 'forever'], array_keys($items), array_values($items));
        } else {
            $items = array_combine($this->tagKeys(array_keys($items)), array_values($items));

            $this->store->foreverMany($items);
        }
    }
1356831
public function putItems(array $items)
    {
        foreach ($items as $k => $v) {
            $this->putItem($k, $v);
        }
    }
1292136
public function replace(array $items): parent {
        $ac = new ArrayCover($this->_data);
        $this->_data = $ac($items);
        return $this;
    }
611468
public function updateMany(array $items)
    {
        $ids    = array_pluck($items, $this->model->getKeyName());
        $models = $this->model->find($ids);

        foreach ($models as $model) {
            $attributes = array_first($items, function ($i, $attributes) use ($model) {
                if (!array_key_exists($model->getKeyName(), $attributes)) {
                    return false;
                }

                return $attributes[$model->getKeyName()] == $model->getKey();
            });

            $this->validation()->validate('update', array_merge($attributes, [$model->getKeyName() => $model->getKey()]));

            $model->fill($attributes);
            $model->save();
        }

        return $models;
    }
1241490
public function setChildren(array $children)
    {

        $this->removeChildren();
        foreach ($children as $child)
            $this->appendChild($child);

        return $this;
    }
609205
public function addMany(array $items, $minutes)
    {
        $values = $this->getMany(array_keys($items));

        $fill = Arr::where($values, function ($key, $value) {
            return is_null($value);
        });

        $items = array_intersect_key($items, $fill);

        $this->putMany($items, $minutes);

        return array_map(function ($value) {
            return is_null($value);
        }, $values);
    }
1217228
protected function isChildActive($items, &$active)
    {
        foreach ($items as $i => $child) {
            if (is_array($child) && !ArrayHelper::getValue($child, 'visible', true)) {
                continue;
            }
            if (ArrayHelper::remove($items[$i], 'active', false) || $this->isItemActive($child)) {
                Html::addCssClass($items[$i]['options'], 'active');
                if ($this->activateParents) {
                    $active = true;
                }
            }
            $childItems = ArrayHelper::getValue($child, 'items');
            if (is_array($childItems)) {
                $activeParent = false;
                $items[$i]['items'] = $this->isChildActive($childItems, $activeParent);
                if ($activeParent) {
                    Html::addCssClass($items[$i]['options'], 'active');
                    $active = true;
                }
            }
        }
        return $items;
    }
924796
public function addMultiple(array $items)
    {
        foreach ($items as $item) {
            if ($item instanceof RequestException) {
                $this->addException($item);
            } else {
                $this->addResponse($item);
            }
        }
    }
151853
public function setItems($items)
    {
        if ($items && !$items instanceof ItemBag) {
            $items = new MulticardsItemBag($items);
        }

        return $this->setParameter('items', $items);
    }
1036271
public function setItems(Collection $items)
    {
        $this->itemsTotal = null;
        $this->total = null;

        foreach ($items as $item) {
            $this->addItem($item);
        }

        return $this;
    }
512526
public function addChildren(array $children)
    {
        if ($this->exists) {
            \DB::connection($this->connection)->transaction(function () use ($children) {
                $lastChildPosition = $this->getLastChildPosition();

                foreach ($children as $child) {
                    if (!$child instanceof EntityInterface) {
                        if (isset($child['id'])) {
                            unset($child['id']);
                        }

                        $child = new static($child);
                    }

                    $this->addChild($child, $lastChildPosition);
                    $lastChildPosition++;
                }
            });
        }

        return $this;
    }
589315
public function add($item)
    {
        if (is_object($item)) {
            $item = (array) $item;
        }

        $this->validate($item);
        $this->addItem($item);

        return true;
    }
170223
public function replace(array $items = [])
    {
        $this->items = [];

        foreach ($items as $key => $item) {
            $this->set($key, $item);
        }
    }
1227742
public function addItems(array $items, $where = '')
    {
        foreach (array_keys($items) as $k) {
            if (!is_int($k) && $this->hasItem($k)) {
                unset($items[$k]);
            }
        }
        if (!empty($items)) {
            $this->setItems($items, $where);
        }

        return $this;
    }
704520
public function addChild(\Amulen\PageBundle\Entity\MenuItem $children)
    {
        $this->children[] = $children;

        return $this;
    }