Make a resource repository instance

@param string $repository
@return Repository
776139
public static function makeResourceRepository(string $repository): Repository
    {
        $api = App::make(ApiClient::class);

        return new $repository($api);
    }
967981
public static function getCachePathByRepository(Repository $repository)
    {
        $path = path('cache') . 'framework/pckg_database_repository_' . str_replace(
                ['\\', '/'],
                '_',
                (get_class(app()) . '_' . get_class(env()))
            ) . '_' . $repository->getName() . '_' . ($repository->getConnection()->uniqueName ?? '') . '.cache';

        return $path;
    }
621564
protected function getModules(Repository $repository)
    {
        $modules = $repository->all();
        $results = [];

        foreach ($modules as $module) {
            $results[] = $this->getModuleInformation($repository, $module);
        }

        return array_filter($results);
    }
778780
public function getOne($repository, $id)
    {
        $repoConfig = $this->repos[$repository];
        /** @var $q \Doctrine\ORM\QueryBuilder */
        return $this->doctrine
            ->getRepository($repoConfig['repository'])
            ->find($id);
    }
889756
public function taxonomy(string $taxonomy): Repository
    {
        $taxonomyArr = $this->taxonomies->get($taxonomy);

        $this->taxonomies = new Collection($taxonomyArr);

        return $this;
    }
453317
protected function getRepositoryUrlCache()
    {
        $repositoryUrlCache = $this->getSession()->get(SessionParameter::REPOSITORY_URL_CACHE);
        if ($repositoryUrlCache === null) {
            $repositoryUrlCache = new RepositoryUrlCache();
            $this->getSession()->put(SessionParameter::REPOSITORY_URL_CACHE, $repositoryUrlCache);
        }

        return $repositoryUrlCache;
    }
272679
public function getCache(): ?Repository
    {
        if (!$this->hasCache()) {
            $this->setCache($this->getDefaultCache());
        }
        return $this->cache;
    }
286371
protected function build(string $modelClass): IRepository
    {
        $repositoryClass = $this->registeredRepositories[$modelClass] ?? Repository::class;

        $parameters = [];

        if ($repositoryClass === Repository::class || is_subclass_of($repositoryClass, Repository::class)
        ) {
            $parameters = ['modelClass' => $modelClass];
        }

        return $this->container->make($repositoryClass, $parameters);
    }
1002566
private function createRepository($entityClass)
    {
        $repository = new EntityRepository();
        $repository->setAdapter(
            $this->adapters->get($this->getAdapterAlias($entityClass))
        )
            ->setEntityMapper($this->getMapperFor($entityClass))
            ->setEntityDescriptor(
                EntityDescriptorRegistry::getInstance()
                    ->getDescriptorFor($entityClass)
            );
        $this->repositories->set($entityClass, $repository);
        return $repository;
    }
198747
public function addRepositories(array $repositories)
    {
        foreach ($repositories as $key => $repository) {
            $this->addRepository($key, $repository);
        }
        return $this;
    }
1155232
public function update(Repository $repository = null)
    {
        if (!$repository) {
            $repository = $this->getRepository();
        }

        $repository = $repository->aliased('write');

        $update = $this->getQuery()->transformToUpdate();

        $update->setSet($this->setData);

        $prepare = $repository->prepareQuery($update);

        return $repository->executePrepared($prepare);
    }
971450
public function withRepository(Repository $repository) : TransactionalBusesBuilder
    {
        $this->repository = $repository;
        $this->useDirectCommandBus();
        return $this;
    }
174606
public function clones($owner, $repository, $per = 'day')
    {
        return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/clones?per='.rawurlencode($per));
    }
930458
public function fetchByRepository($repository)
    {
        $apiPackage = $this->client->get($repository);
        if ($apiPackage && $apiPackage instanceof ApiPackage) {
            // create a new Package from the ApiPackage
            $class = self::$packageClass;

            return $class::createFromApi($apiPackage);
        }

        throw new UnexpectedValueException(sprintf('Impossible to fetch package by "%s" repository.', $repository));
    }
792118
private function resolveRepositoryName($repository)
    {
        if ($repository === null) {
            $aliases = array_keys($this->repositories);
            $repository = array_shift($aliases);
        }

        return $repository;
    }
55037
public function delete(Repository $repository = null)
    {
        if (!$repository) {
            $repository = $this->getRepository();
        }

        $repository = $repository->aliased('write');

        $delete = $this->getQuery()->transformToDelete();

        $prepare = $repository->prepareQuery($delete);

        return $repository->executePrepared($prepare);
    }
436539
public function repos($username, array $params = array())
    {
        $httpClient = $this->getClient()->getHttpClient();

        return new RepositoryCollection(
            $httpClient,
            'users/' . urlencode($username) . '/repos',
            $params
        );
    }