Add multiple SitemapAware objects to the sitemap.

@param array|Traversable $objects
492286
public function addAll($objects)
	{
		if (is_a($objects, 'Closure')) {
			return $this->closures[] = $objects;
		}

		foreach ($objects as $object) {
			$this->add($object);
		}
	}
1361306
public function addApps(ArrayCollection $apps)
    {
        foreach ($apps as $app) {
            $app->addPage($this);
            $this->apps->add($app);
        }
    }
949718
public function add(array $items) {
		
		foreach($items as $name => $object) {
			$this->set($name, $object);
		}
		
		return $this;
	}
57784
private function remapObjectParameters(array $objects, ContainerBuilder $container)
    {
        foreach ($objects as $object => $services) {
            foreach ($services as $service => $class) {
                $container->setParameter(
                    sprintf(
                        'sulu.%s.%s.class',
                        $service,
                        $object
                    ),
                    $class
                );
            }
        }
    }
1200061
protected function fillSitemap( $sitemap, $root, SearchResult $results )
    {
        foreach ( $results->searchHits as $searchHit )
        {
            /**
             * @var SearchHit $searchHit
             * @var Location  $location
             *
             */
            $location = $searchHit->valueObject;
            $url      = $this->generateUrl( $location, [ ], UrlGeneratorInterface::ABSOLUTE_URL );
            $modified = $location->contentInfo->modificationDate->format( "c" );
            $loc      = $sitemap->createElement( "loc", $url );
            $lastmod  = $sitemap->createElement( "lastmod", $modified );
            $urlElt   = $sitemap->createElement( "url" );
            $urlElt->appendChild( $loc );
            $urlElt->appendChild( $lastmod );
            $root->appendChild( $urlElt );
        }
    }
1283759
public function persist($objects)
    {
        if (!is_array($objects) && !$objects instanceof \Traversable) {
            $objects = array($objects);
        }
        foreach ($objects as $object) {
            if (!is_object($object)) {
                throw new UnexpectedTypeException($object, 'object');
            }
            $this->unitOfWork->persist($object);
        }
    }
401371
public function addMaps(array $maps)
    {
        foreach ($maps as $pattern => $variables) {
            $this->addMap($pattern, $variables);
        }

        return $this;
    }
1204027
public function saveSitemapItem($slug, $postValues)
    {
        $sitemapObject = SitemapItemFactory::createSitemapItemFromPostValues($postValues);

        $sitemap = $this->repository->sitemap;
        foreach ($sitemap as $key => $sitemapItem) {
            if ($sitemapItem->slug == $slug) {
                $sitemap[$key] = $sitemapObject;
            }
        }
        $this->repository->sitemap = $sitemap;
        $this->save();
    }
282130
public function add($object)
    {
        if ($this->removedNodes->contains($object)) {
            $this->removedNodes->detach($object);
        }
        if (!$this->addedNodes->contains($object)) {
            $this->addedNodes->attach($object);
        }
        parent::add($object);
    }
287271
public function update(array $objects) {
        $requests = [];

        foreach ($objects as $object) {
            $requests[] = [
                'method' => 'cmdb.object.update',
                'params' => $object
            ];
        }

        $this->api->batchRequest($requests);

        return $this;
    }
713444
public function persistAllObjects(PersistenceContext $context, array $objects) : array
    {
        $rows = [];

        foreach ($objects as $key => $object) {
            $rows[$key] = new Row($this->table);
        }

        $this->persistAll($context, $objects, $rows);

        return $rows;
    }
1030960
public function addObject($object)
    {
        $item = $this
            ->transformer
            ->toItem($object);

        if ($item instanceof Item) {
            $this->addItem($item);
        }
    }
118101
private function defineRepositories(array $objects, ContainerBuilder $container)
    {
        foreach ($objects as $object => $services) {
            if (array_key_exists('model', $services)) {
                $repositoryDefinition = $this->getRepositoryDefinition($object, $services, $container);

                $container->setDefinition(
                    $this->getContainerKey('repository', $object),
                    $repositoryDefinition
                )->setPublic(true);
            }
        }
    }
988313
public function runSitemapComponents($matchedSitemapItems)
    {
        foreach ($matchedSitemapItems as $key => $sitemapItem) {
            $class = $sitemapItem->component;
            $template = $sitemapItem->template;
            $parameters = $sitemapItem->parameters;

            $matchedSitemapItems[$key]->object = $this->getComponentObject($class, $template, $parameters,
                $sitemapItem);

            if ($matchedSitemapItems[$key]->object instanceof CachableBaseComponent
                && $matchedSitemapItems[$key]->object->isCachable()
                && $matchedSitemapItems[$key]->object->isCacheValid()) {
                continue;
            }

            $matchedSitemapItems[$key]->object->run($this->storage);
        }
    }
1208567
private function executeMoves($documents)
    {
        foreach ($documents as $oid => $value) {
            if (!$this->contains($oid)) {
                continue;
            }

            list($document, $targetPath) = $value;

            $sourcePath = $this->getDocumentId($document);
            if ($sourcePath === $targetPath) {
                continue;
            }

            $class = $this->dm->getClassMetadata(get_class($document));
            if ($invoke = $this->eventListenersInvoker->getSubscribedSystems($class, Event::preMove)) {
                $this->eventListenersInvoker->invoke(
                    $class,
                    Event::preMove,
                    $document,
                    new MoveEventArgs($document, $this->dm, $sourcePath, $targetPath),
                    $invoke
                );
            }

            $parentNode = $this->session->getNode(PathHelper::getParentPath($targetPath));
            $this->validateChildClass($parentNode, $class);

            $this->session->move($sourcePath, $targetPath);

            // update fields nodename, parentMapping and depth if they exist in this type
            $node = $this->session->getNode($targetPath); // get node from session, document class might not map it
            if ($class->nodename) {
                $class->setFieldValue($document, $class->nodename, $node->getName());
            }

            if ($class->parentMapping) {
                $class->setFieldValue($document, $class->parentMapping, $this->getOrCreateProxyFromNode($node->getParent(), $this->getCurrentLocale($document, $class)));
            }

            if ($class->depthMapping) {
                $class->setFieldValue($document, $class->depthMapping, $node->getDepth());
            }

            // update all cached children of the document to reflect the move (path id changes)
            foreach ($this->documentIds as $childOid => $id) {
                if (0 !== strpos($id, $sourcePath)) {
                    continue;
                }

                $newId = $targetPath.substr($id, strlen($sourcePath));
                $this->documentIds[$childOid] = $newId;

                $child = $this->getDocumentById($id);
                if (!$child) {
                    continue;
                }

                unset($this->identityMap[$id]);
                $this->identityMap[$newId] = $child;

                $childClass = $this->dm->getClassMetadata(get_class($child));
                if ($childClass->identifier) {
                    $childClass->setIdentifierValue($child, $newId);
                    if (!$child instanceof Proxy || $child->__isInitialized()) {
                        $this->originalData[$childOid][$childClass->identifier] = $newId;
                    }
                }
            }

            if ($invoke = $this->eventListenersInvoker->getSubscribedSystems($class, Event::postMove)) {
                $this->eventListenersInvoker->invoke(
                    $class,
                    Event::postMove,
                    $document,
                    new MoveEventArgs($document, $this->dm, $sourcePath, $targetPath),
                    $invoke
                );
            }
        }
    }
1302263
public function addRepositories($repositories)
    {
        if (!is_array($repositories) && (!is_object($repositories) || !$repositories instanceof \Traversable)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid argument provided for $repositories, expecting either an array or Traversable object, but' .
                ' "%s" given',
                is_object($repositories) ? get_class($repositories) : gettype($repositories)
            ));
        }
        foreach ($repositories as $repo) {
            $this->addRepository($repo);
        }
    }
763825
public function addClassMethodLocations(array $references)
    {
        foreach ($references as $referenced_member_id => $locations) {
            if (isset(self::$class_method_locations[$referenced_member_id])) {
                self::$class_method_locations[$referenced_member_id] = array_merge(
                    self::$class_method_locations[$referenced_member_id],
                    $locations
                );
            } else {
                self::$class_method_locations[$referenced_member_id] = $locations;
            }
        }
    }