@param                     $model
@param Repository          $repository

@return mixed
431979
public function apply($model, Repository $repository)
    {
        $model = $model->where("pid", $this->id);

        return $model;
    }
59499
public function getRepository($modelName, $collection = null)
    {
        return $this->repositoryFactory->getRepository($this, $modelName, $collection);
    }
1218528
public static function createFromOutputLines(Repository $repository, array $outputLines)
    {
        $log = new self($repository);
        $log->parseOutputLines($outputLines);

        return $log;
    }
522809
public function fetchBuilds(Repository $repository)
    {
        $response = $this->getResponse(
            sprintf('/repos/%s/builds',$repository->getSlug()),
            array());

        if (is_array($response)) {
            // Load project builds
            foreach ($response as $buildData) {
                $build = new Build();
                // Add build to repository instance
                $repository->addBuild($this->hydrate($build, $buildData));
            }
        }

        return $repository;
    }
1267983
protected function getMigrationPaths(Repository $repository)
    {
        $slug  = $this->argument('slug');
        $paths = [];

        if ($slug) {
            $paths[] = module_path($slug, 'Database/Migrations', $repository->location);
        } else {
            foreach ($repository->all() as $module) {
                $paths[] = module_path($module['slug'], 'Database/Migrations', $repository->location);
            }
        }

        return $paths;
    }
665069
protected function doCanFilterWithRepository(
        Collection $collection,
        Repository $repository
    ){
        /**
         * @var Filter[] $filters
         */
        $filters = $this->getFilters();

        foreach ($filters as $filter) {
            if (!$filter->canFilterWithRepository($collection, $repository)){
                return false;
            }
        }

        return true;
    }
394192
protected function execute( InputInterface $input, OutputInterface $output ) {
		Log::instance()->setOutput( $output );

		$repository = RepositoryManager::instance()->setup( $input->getOption( 'repository' ) );

		if ( ! $repository ) {
			Log::instance()->write( 'Could not setup repository.', 0, 'error' );
			return 1;
		}

		$id = $input->getArgument( 'snapshot_id' );

		$snapshot = $repository->getDB()->getSnapshot( $id );

		if ( ! $snapshot ) {
			Log::instance()->write( 'Could not get snapshot from database.', 0, 'error' );

			return 1;
		}

		$files_result = $repository->getS3()->deleteSnapshot( $id, $snapshot['project'] );

		if ( ! $files_result ) {
			Log::instance()->write( 'Could not delete snapshot.', 0, 'error' );

			return 1;
		}

		$db_result = $repository->getDB()->deleteSnapshot( $id );

		if ( ! $db_result ) {
			Log::instance()->write( 'Could not delete snapshot.', 0, 'error' );

			return 1;
		}

		Log::instance()->write( 'Snapshot deleted.', 0, 'success' );
	}
571250
public function setRepository(Repository $model, $default = null, callable $handler = null, $customName = null)
    {
        // B/C
        if (is_string($handler)) {
            $customName = $handler;
        } elseif (is_callable($handler)) {
            $handler($model, $this);
        }

        $this->repository->setRepository($model, $default, $customName);

        return $this;
    }
602658
protected function getCachedDataRepository($repositoryName) {
		return array_key_exists($repositoryName, $this->cachedDataRepositories) ? $this->cachedDataRepositories[$repositoryName]:null;
	}
255919
public function repository($entity)
    {
        if (!is_string($entity)) {
            $entity = get_class($entity);
        }

        // First we check if the repository is not already created.
        if (array_key_exists($entity, $this->repositories)) {
            return $this->repositories[$entity];
        }

        $this->repositories[$entity] = new Repository($this->mapper($entity));

        return $this->repositories[$entity];
    }
295397
public function delete($id)
    {
        $model = $this->find($id);

        if (!$model) {
            throw new RepositoryException("O item não solicitado não existe.");
        }

        return $model->delete();
    }
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);
    }
428126
public function apply($model, \Prettus\Repository\Contracts\RepositoryInterface $repository)
    {
        $limit = $this->request->get('limit', null);
        $offset = $this->request->get('offset', null);

        if ($limit) {
            $model = $model->limit($limit);
        }

        if ($offset && $limit) {
            $model = $model->skip($offset);
        }

        return $model;
    }
1056949
public function update($model)
    {
        $error = $this->repository->update(Request::all()) ? false : true;

        return response()->json([
            'error' => $error,
        ], 200);
    }
987650
private function register(
        Entity $meta,
        Repository $repository
    ): self {
        $this->repositories = $this->repositories->put(
            $meta,
            $repository
        );

        return $this;
    }
541504
private function getRelations(Repository $repository, array $relations = [])
    {
        // if we have relation array passed, ignore request input
        if (count($relations) === 0) {
            $relations = Input::get('with');

            if (!is_array($relations)) {
                $relations = $this->inputService->decode('with');
            }
        }

        $result = [];
        $repo_relations = $repository->relations();
        foreach ($relations as $key => $value) {
            if (in_array($key, $repo_relations)) {
                $result[] = $key;
            } elseif (in_array($value, $repo_relations)) {
                $result[] = $value;
            }
        }

        return $result;
    }
969309
protected function getCollection(RepositoryInterface $repository, callable $comparator = null)
    {
        $versions = $repository->fetchAll();
        if ($comparator) {
            $versions->sortWith($comparator);
        }

        return $versions;
    }