@param Repository $repository

@return mixed
190661
protected function buildAsDeep(Repository $repository)
    {
        $build = [];

        if (! $this->checkPermission($this, $repository)) {
            return;
        }

        foreach ($this->layouts as $key => $layouts) {
            $layouts = Arr::wrap($layouts);

            $build += $this->buildChild($layouts, $key, $repository);
        }

        $variables = array_merge($this->variables, [
            'manyForms'           => $build,
            'templateSlug'        => $this->getSlug(),
            'templateAsync'       => $this->asyncNext,
            'templateAsyncMethod' => $this->asyncMethod,
        ]);

        return view($this->async ? 'platform::container.layouts.blank' : $this->template, $variables);
    }
1190068
public function find(Repository $repository = null): array
    {
        if (!$repository && !($repository = $this->repository)) {
            throw new \RuntimeException('The current Query object is not tied to any Repository');
        }

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

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

        return array_filter($results);
    }
201067
protected function parseRepository($repository)
    {
        if (preg_match('([^A-Za-z0-9_/\\\\])', $repository)) {
            throw new InvalidArgumentException('Repository name contains invalid characters.');
        }

        $repository = trim(str_replace('/', '\\', $repository), '\\');

        if (! Str::startsWith($repository, $rootNamespace = $this->laravel->getNamespace())) {
            $repository = $rootNamespace.'Repositories'.'\\'.$repository;
        }

        return $repository;
    }
56517
protected function validSlugProvided(Repository $repository)
    {
        if (empty($this->argument('slug'))) {
            return false;
        }

        if ($repository->isEnabled($this->argument('slug'))) {
            return true;
        }

        if ($this->option('force')) {
            return true;
        }

        return false;
    }
99140
public function findByRepositoryUrl($repositoryUrl)
    {
        $presets = $this->loadPresets();
        $repositoryPresets = [];
        foreach ($presets as $key => $preset) {
            foreach ($preset['applications'] as $application) {
                if (!empty($application['options']['repositoryUrl']) && $repositoryUrl === $application['options']['repositoryUrl']) {
                    $repositoryPresets[$key] = $preset;
                }
            }
        }
        return $repositoryPresets;
    }
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;
    }
243296
private function findRecords($repository, $pattern, $language = null)
    {
        $repoConfig = $this->repos[$repository];
        /** @var $q \Doctrine\ORM\QueryBuilder */
        $q = $this->doctrine
            ->getRepository($repoConfig['repository'])
            ->createQueryBuilder('i')
            ->setMaxResults(1500);
        $eb = $q->expr();
        $expr = $eb->orX();
        foreach ($repoConfig['fields'] as $fieldName) {
            $expr->add($eb->like($eb->lower('i.' . $fieldName), $eb->lower(':pattern')));
        }
        $q->where($expr);

        $params = array('pattern' => '%' . $pattern . '%');

        if (null !== $language) {
            $q->andWhere('i.language = :lang');
            $params[':lang'] = $language;
        }

        return $q->getQuery()->execute($params);
    }
1230990
protected function getMigrationPaths(Repository $repository) {
        $migrationPaths = [];

        foreach ($this->getSlugsToReset($repository) as $slug) {
            $migrationPaths[] = $this->getMigrationPath($slug, $repository);

            event($slug.'.module.reset', [$this->module, $this->option()]);
        }

        return $migrationPaths;
    }
387043
public function fetchRepository(Repository $repository, $withBuild = true)
    {
        $response = $this->getResponse(
            sprintf('/repos/%s',$repository->getSlug()),
            array()
        );
        // Hydrate response into repository
        $project = $this->hydrate($repository, $response);

        if (!$withBuild) {
            return $project;
        }
        // Load Repository builds
        return $this->fetchBuilds($repository);
    }
240522
public function execute($repositoryUrl)
    {
        $this->arguments[] = $repositoryUrl;
        $this->arguments[] = $this->repository->getRepositoryPath();
        return $this->run();
    }
517599
public function addRepository($repository)
    {
        $class = $repository->getModelClass();
        if ($this->getByClass($class)) {
            throw new RepositoryException("The manager already contains a repository for the model class '$class'");
        }
        
        $repository->setManager($this);
        $this->repositories[$class] = $repository;
    }
272679
public function getCache(): ?Repository
    {
        if (!$this->hasCache()) {
            $this->setCache($this->getDefaultCache());
        }
        return $this->cache;
    }
625588
public function unlock(EntityInterface $entity, RepositoryInterface $repository)
    {
        return $this->setStateFor(State::UNLOCKED, $entity, $repository);
    }
56409
protected function createRepository(ObjectAccess $repository)
    {
        if ($repository->exists('packagist')) {
            return new PackagistRepository(
                $repository->get('packagist'),
                $repository->data()
            );
        }

        $type = $repository->get('type');

        if ('package' === $type) {
            $repository = new PackageRepository(
                $this->objectToArray($repository->get('package')),
                $this->objectToArray($repository->getDefault('options')),
                $repository->data()
            );
        } else {
            $repository = new Repository(
                $type,
                $repository->getDefault('url'),
                $this->objectToArray($repository->getDefault('options')),
                $repository->data()
            );
        }

        return $repository;
    }
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));
    }
133920
public function get_root_path($repository){
    if ( \is_string($repository) ){
      $repository = $this->repository($repository);
    }
    if ( !empty($repository) && !empty($repository['bbn_path']) ){
      $repository_path = !empty($repository['path']) ? '/' . $repository['path'] : '';
      $path = self::decipher_path($repository['bbn_path'] . $repository_path) . '/';
      return \bbn\str::parse_path($path);
    }
    return false;
  }