关闭自定义启动项

@param  string $type
@param  array  $items
766460
protected function shutdownItems(string $type, array $items)
    {
        if ($items !== []) {
            array_walk($items, function ($item) use ($type) {
                $provider = $this->make($item, [$this]);
                $provider->shutdown();

                unset($boot);

                // {{ log
                $this->get('logger')->info('关闭 ' . ucfirst($type) . ' 启动项 ' . $item);
                // }}
            });
        }
    }
1033025
public function associate($type, array $items = null)
    {
        if ($this->getOwner() === null) {
            throw new DomainException('Unable to associate relations to a collection that does not have an owning entity!');
        }
        if ($type instanceof Entity\Content) {
            $this->addEntity((string) $type->getContenttype(), $type->getId(), $this->getOwner());

            return;
        }

        if (is_iterable($type)) {
            foreach ($type as $entity) {
                if ($entity instanceof Entity\Content) {
                    $this->associate($entity);
                }
            }

            return;
        }

        foreach ($items as $item) {
            $this->addEntity($type, $item, $this->getOwner());
        }
    }
403140
protected function prepareEntityItems(array &$items, $options = array())
    {
        if (!empty($items) && isset($options['entity'])) {

            if (!isset($options['view']) || !in_array($options['view'], array('list', 'grid'))) {
                $options['view'] = 'grid';
            }

            $options += array(
                'entity' => $options['entity'],
                'entity_id' => array_keys($items),
                'template_item' => "{$options['entity']}/item/{$options['view']}",
                'imagestyle' => $this->configTheme("image_style_{$options['entity']}_{$options['view']}", 3)
            );

            foreach ($items as &$item) {
                $this->prepareEntityItem($item, $options);
            }
        }
    }
768296
public function setItems($items)
    {
        foreach ($this->items as $item) {
            $item->setOrder(null);
        }
        foreach ($items as $item) {
            $item->setOrder($this);
        }
        $this->items = $items;
        return $this;
    }
87956
protected function processItems(array $items)
    {
        $processedItems = [];

        foreach ($items as $entry) {
            $processedItems[] = ModelFactory::make($entry);
        }

        $this->items = new ModelCollection($processedItems);
    }
540839
public function setItems(iterable $items): void
    {
        if ($items instanceof ItemList) {
            $this->items = clone $items;
        } else {
            $this->items = new ItemList();
            foreach ($items as $item) {
                $this->items->insert($item);
            }
        }
    }
1198502
private function writeItems(array $items, string $cmdStyle)
    {
        foreach ($items as $cmd => $desc) {
            // 没有命令，只是一行数据
            if (\is_int($cmd)) {
                $message = self::LEFT_CHAR . $desc;
                $this->writeln($message);
                continue;
            }

            // 命令和描述
            $maxLength = $this->getCmdMaxLength(array_keys($items));
            $cmd = \str_pad($cmd, $maxLength, ' ');
            $cmd = "<$cmdStyle>$cmd</$cmdStyle>";
            $message = self::LEFT_CHAR . $cmd . self::GAP_CHAR . $desc;

            $this->writeln($message);
        }
    }
205617
protected function removeAllItems($type)
    {
        if (!$this->supportsCascadeUpdate()) {
            $names = (new Query)
                ->select(['name'])
                ->from($this->itemTable)
                ->where(['type' => $type])
                ->column($this->db);
            if (empty($names)) {
                return;
            }
            $key = $type == Item::TYPE_PERMISSION ? 'child' : 'parent';
            $this->db->createCommand()
                ->delete($this->itemChildTable, [$key => $names])
                ->execute();
            $this->db->createCommand()
                ->delete($this->assignmentTable, ['item_name' => $names])
                ->execute();
        }
        $this->db->createCommand()
            ->delete($this->itemTable, ['type' => $type])
            ->execute();

        $this->_assignments = [];
        $this->_children = $this->_items = null;

        $this->invalidate(static::PART_ITEMS);
        $this->invalidate(static::PART_CHILDREN);
    }
1325511
public function addItems(array $items, $append = true)
    {
        $this->_items = $this->mergeItems($this->_items, $items, $append);
    }
652779
public function setItems(array $items)
    {
        $this->items = $items;
        $this->names = array_keys($items);

        return $this;
    }
527356
protected function createPerimeter($type, array $items)
    {
        $perimeter = new Perimeter($type);

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

        return $perimeter;
    }
1127096
protected function outputFormatTableDatabase(array $items)
    {
        $header = $rows = array();

        if (!empty($items)) {

            $first = reset($items);
            $header = array_keys($first);

            foreach ($items as $item) {
                $rows[] = array_values($item);
            }
        }

        $this->outputFormatTable($rows, $header);
    }
238285
public function setItems($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $this->addBody($items);

        return $this;
    }
678701
public function update(array $items = [])
    {
        $brandId = $this->getDefaultBrandId();
        $changed = $this->verify($items, $brandId);

        Memory::make('component.default')->put('terminate', (int) $changed);
        if ($changed) {
            $this->keyMap = [];
        }
        if ($changed && $this->cache instanceof Repository) {
            $this->cache->forget($this->cacheKey);
        }
    }
684331
public function setItems(array $items)
    {
        if (is_array($items)) {
            $i = array();
            foreach ($items as $key => $item) {
                if ($item instanceof PagSeguroItem) {
                    $i[$key] = $item;
                } else {
                    if (is_array($item)) {
                        $i[$key] = new PagSeguroItem($item);
                    }
                }
            }
            $this->items = $i;
        }
    }
2225
public function merge(array $items)
    {
        $this->items = $this->arrayMergeRecursive($this->items, $items);
        $this->nestedKeyCache = [];
    }
1066252
public function setBindings(array $bindings, $type = 'where') {
        if (! array_key_exists($type, $this->bindings)) {
            throw new InvalidArgumentException(
                __('Invalid binding type: ').$type
            );
        }

        $this->bindings[$type] = $bindings;

        return $this;
    }