Resets the stack to the specified repositories

@param array|\Traversable $repositories
@throws InvalidArgumentException
168678
public function setRepositories($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)
            ));
        }
        $this->stack = new \SplStack();
        $this->addRepositories($repositories);
    }
639483
public function setManipulators(array $manipulators)
    {
        foreach ($manipulators as $manipulator) {
            if (!($manipulator instanceof ManipulatorInterface)) {
                throw new InvalidArgumentException('Not a valid manipulator.');
            }
        }

        $this->manipulators = $manipulators;
    }
791234
public function reset(array $keys)
    {
        foreach ($keys as $key) {
            $this->getSettingOrFail($key);
        }

        $this->backend->removeSettings($keys);
    }
1081990
public function resetAllTranslationFlags()
    {
        if (null === $this->translationRepository) {
            $this->translationRepository = $this->getContainer()->get('kunstmaan_translator.repository.translation');
        }

        $this->translationRepository->resetAllFlags();
    }
437530
def update_repositories(repositories, conf_path):
    
    repo_file = "{0}custom-repositories".format(conf_path)
    if os.path.isfile(repo_file):
        f = open(repo_file, "r")
        repositories_list = f.read()
        f.close()
        for line in repositories_list.splitlines():
            line = line.lstrip()
            if line and not line.startswith("#"):
                repositories.append(line.split()[0])
    return repositories
1054797
public function setAliases($aliases)
    {
        if (!is_array($aliases) && !$aliases instanceof \Traversable) {
            throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
        }

        foreach ($aliases as $alias) {
            $this->validateName($alias);
        }

        $this->aliases = $aliases;

        return $this;
    }
1069480
public function flush($flushEntityManager = false)
    {
        $this->queue->rewind();

        while ($this->queue->valid()) {
            list($item, $mode) = $this->queue->dequeue();
            switch ($mode) {
                case self::REMOVE:
                    if (($repo = $this->getRepository(get_class($item))) && $repo instanceof NestedTreeRepository) {
                        $repo->removeFromTree($item);
                    } else {
                        $this->doctrine->getManager()->remove($item);
                    }
                    break;
                case self::ADD:
                    $this->doctrine->getManager()->persist($item);
                    break;
            }
            $this->queue->next();
        }

        if ($flushEntityManager) {
            $this->doctrine->getManager()->flush();
        }
    }
379815
public function setFileSystem($fileSystem)
    {
        if (! is_object($fileSystem) || ! is_a($fileSystem, 'Symfony\Component\Filesystem\Filesystem')) {
            throw new \InvalidArgumentException(
                'The File System was not a valid object.'
            );
        }
        $this->fileSystem = $fileSystem;
    }
1101372
public synchronized void refresh() {
        if (repositoriesJson != null) {
            initRepositoriesFromJson();
        }
        for (UpdateRepository updateRepository : repositories) {
            updateRepository.refresh();
        }
        lastPluginRelease.clear();
    }
215532
public function setRepository($repository)
    {
        if (!$this->_repository instanceof AnDomainRepositoryAbstract) {
            if (is_string($repository) && strpos($repository, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->type = 'repos';
                $identifier->path = array();
                $identifier->name = $repository;
            } else {
                $identifier = $this->getIdentifier($repository);
            }

            $repository = $identifier;
        }

        $this->_repository = $repository;
    }
1157832
public function cleanupNodesWithIds($ids)
    {
        $ids = array_merge($this->getRelatedNodeIds($ids), $ids);

        if (!empty($ids)) {
            $repositories = $this->getNodeRepositories($ids);

            //delete all the nodes
            $this->getService('repos:base.node')->destroy($ids);

            //set the creator,updator,authors to null
            $in = '('.implode(',', $ids).')';
            $query[] = "last_comment_id = IF(last_comment_id IN $in, NULL, last_comment_id)";
            $query[] = "created_by = IF(created_by IN $in, NULL, created_by)";
            $query[] = "modified_by = IF(modified_by IN $in, NULL, modified_by)";
            $query[] = "last_comment_by = IF(last_comment_by IN $in, NULL, last_comment_by)";
            $query = implode(', ', $query);
            $where = $this->getService('repos:base.node')
                        ->getQuery()
                        ->where("last_comment_by IN $in OR created_by IN $in OR modified_by IN $in OR last_comment_by IN $in");

            $this->getService('repos:base.node')->update($query, $where);

            //cleanup all the relationship of every deleted node
            $query = $this->getService('repos:base.edge')
                ->getQuery()
                ->where('nodeA.id', 'IN', $ids)
                ->where('nodeB.id', 'IN', $ids, 'OR');

            $this->getService('repos:base.edge')->destroy($query);

            //now lets the repositories know so they can
            //handle the cleanup
            foreach ($repositories as $repository) {
                $context = $repository->getCommandContext();
                $context->node_ids = $ids;
                $repository->getCommandChain()->run('after.deletenodes', $context);
            }
        }
    }
610899
def configure(self, repositories):
        
        self.enable_repositories(repositories)
        self.create_stack_user()
        self.install_base_packages()
        self.clean_system()
        self.yum_update(allow_reboot=True)
        self.install_osp()
        self.set_selinux('permissive')
        self.fix_hostname()
1001715
public function setMapEntries(MapEntryCollection $mapEntries)
    {
        if (count($mapEntries) > 0) {
            $this->mapEntries = $mapEntries;
        } else {
            $msg = "A Mapping object must contain at least one MapEntry object, none given.";
            throw new InvalidArgumentException($msg);
        }
    }
373713
public function setCollections($collections)
    {
        if (!is_array($collections) && !$collections instanceof Traversable) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s: expects an array or Traversable, received "%s"',
                __METHOD__,
                (is_object($collections) ? get_class($collections) : gettype($collections))
            ));
        }

        if ($collections instanceof Traversable) {
            $collections = ArrayUtils::iteratorToArray($collections);
        }

        $this->collections = $collections;
    }
473522
public function addRepository(RepositoryInterface $repository)
    {
        if ($repository instanceof IssueRepository) {
            $type = 'issue';
        } else {
            throw new \Exception('Unknown repository type.');
        }

        $this->repositories[$type] = $repository;
    }
883509
private function setAssociatedEntities(array $repositories)
    {
        $newEntities = [];

        foreach ($repositories as $repositoryName => $findMethods) {
            foreach ($findMethods as $findMethod => $groupedBySortAssociatedEntitiesToWarm) {
                foreach ($groupedBySortAssociatedEntitiesToWarm as $orderByToken => $groupedAssociatedEntitiesToWarm) {
                    $associatedEntitiesToWarm = $groupedAssociatedEntitiesToWarm['entitiesToWarm'];

                    //Extract ids to search
                    $idsToSearch = array_map(function ($associatedEntityToWarm) {
                        return $associatedEntityToWarm->getEntityId();
                    }, $associatedEntitiesToWarm);

                    $orderBy = [];
                    if ($orderByToken !== 'unsorted') {
                        foreach ($groupedAssociatedEntitiesToWarm['orderBy'] as $orderAttribut => $order) {
                            $orderBy[$orderAttribut] = $order;
                        }
                    }

                    //Find by id for ManyToOne associations based on target entity id
                    //Find by mappedBy value for OneToMany associations based on owner entity id
                    $foundEntities = $this->em->getRepository($repositoryName)->findBy([
                        $findMethod => array_values($idsToSearch),
                    ], $orderBy);

                    /* @var AssociatedEntityToWarm[] $associatedEntitiesToWarm */
                    foreach ($associatedEntitiesToWarm as $associatedEntityToWarm) {
                        foreach ($foundEntities as $foundEntity) {
                            if ($associatedEntityToWarm->getType() === AssociatedEntityToWarm::TYPE_MANY_TO_ONE
                                && $foundEntity->getId() === $associatedEntityToWarm->getEntityId()
                            ) {
                                $inheritorEntity = $associatedEntityToWarm->getInheritorEntity();
                                $inheritorPropertyName = $associatedEntityToWarm->getInheritorPropertyName();
                                $this->accessor->setValue($inheritorEntity, $inheritorPropertyName, $foundEntity);
                                continue;
                            } elseif ($associatedEntityToWarm->getType() === AssociatedEntityToWarm::TYPE_ONE_TO_MANY
                                && $this->accessor->getValue($foundEntity, $findMethod) === $associatedEntityToWarm->getInheritorEntity()
                            ) {
                                $inheritorEntity = $associatedEntityToWarm->getInheritorEntity();
                                $inheritorPropertyName = $associatedEntityToWarm->getInheritorPropertyName();

                                //Don't use Collection getter directly and override Collection
                                //default behaviour to avoid useless query
                                $getter = 'get'.ucwords($inheritorPropertyName);
                                $inheritorEntity->$getter()->add($foundEntity);
                                $inheritorEntity->$getter()->setDirty(false);
                                $inheritorEntity->$getter()->setInitialized(true);

                                //Store new entities to warm if necessary
                                $newEntities[] = $foundEntity;
                                continue;
                            }
                        }
                    }
                }
            }
        }

        return $newEntities;
    }
1221386
public function load($entities, $depth = 1)
    {
        if (!\is_array($entities) && !$entities instanceof \Traversable) {
            throw new \InvalidArgumentException(self::E_MSG);
        }

        $entitiesByValueClassByIds = $this->sortEntitiesByValueClass($entities);
        foreach ($entitiesByValueClassByIds as $valueClass => $entitiesById) {
            $this->loadEntityValues($valueClass, $entitiesById);
        }

        $this->loadRelatedEntities($entities, $depth);
    }