@inheritdoc

@throws RepositoryException
6308
public function create(RedirectUriInterface $redirectUri): RedirectUriInterface
    {
        try {
            $now    = $this->ignoreException(function (): DateTimeImmutable {
                return new DateTimeImmutable();
            });
            $schema = $this->getDatabaseSchema();
            $this->createResource([
                $schema->getRedirectUrisClientIdentityColumn() => $redirectUri->getClientIdentifier(),
                $schema->getRedirectUrisValueColumn()          => $redirectUri->getValue(),
                $schema->getRedirectUrisCreatedAtColumn()      => $now,
            ]);
            $identifier = $this->getLastInsertId();

            $redirectUri->setIdentifier($identifier)->setCreatedAt($now);

            return $redirectUri;
        } catch (RepositoryException $exception) {
            $message = 'Client redirect URI creation failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
1326850
public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
    {
        try {
            if (repository != null)
            {
                boolean duplicate = false;
                for (Repository repo : repositoryAdmin.listRepositories())
                {
                    if (repository.equalsIgnoreCase(repo.getURI()))
                        duplicate = true;
                }
                if (!duplicate)
                {
                    Repository repo = repositoryAdmin.addRepository(repository);
                    if (repo == null)
                        repositoryAdmin.removeRepository(repository);   // Ignore repos not found
                }
            }
        } catch (Exception e) {
            // Ignore exception e.printStackTrace();
        }
    }
873499
public function resolveRepositoryConfig(array $repositoryConfig)
    {
        $resolver = new OptionsResolver();
        $resolver
            ->setDefaults(array(
                'path' => null,
                'commands' => array(),
                'options' => array(),
                'branch' => array(),
            ))
            ->setAllowedTypes('commands', 'array')
            ->setAllowedTypes('options', 'array')
            ->setAllowedTypes('branch', 'array')
            ->setAllowedTypes('path', array('string', 'null'))
        ;

        try {
            return $resolver->resolve($repositoryConfig);
        } catch (InvalidArgumentException $exception) {
            $this->logger->critical('Couldn\'t resolve repository config: '.$exception->getTraceAsString());
            throw $exception;
        }
    }
789436
protected function makeRepository()
    {
        $full_path = $this->getFullRepositoryPath();
        if (file_exists($full_path)) {
            throw new RepositoryExistsException(sprintf('%s file already exists', $full_path));
        }
        $contract_contents = str_replace(
            [
                '%%MODEL_BASENAME%%',
                '%%MODEL_NAME%%',
                '%%CLASS_NAME%%',
                '%%NAMESPACE%%',
                '%%CONTRACT%%',
            ],
            [
                $this->getModelBasename(),
                $this->getModelName(),
                $this->getRepositoryBaseName(),
                trim($this->getRepositoriesNamespace(), '\\'),
                $this->getContractsNamespace() . '\\' . $this->getContractBaseName(),

            ],
            $this->contentsFromStub('Repository')
        );
        if (!file_exists(dirname($full_path))) {
            mkdir(dirname($full_path), 0755, true);
        }
        file_put_contents($full_path, $contract_contents);
    }
909644
public function handle(ModelInformationRepositoryInterface $repository)
    {
        $model = $this->argument('model');

        if ( ! $model) {

            $infos = $repository->getAll();

        } else {

            $info = $repository->getByKey($model);

            if ( ! $info) {
                $info = $repository->getByModelClass($model);
            }

            if ( ! $info) {
                $this->error("Unable to find information for model by key or class '{$model}'");
                return;
            }

            $infos = new Collection([ $info ]);
        }


        $config = $this->getBaseConfiguration();

        foreach ($infos as $info) {
            $this->writeInformation($info, $config);
        }
    }
475199
@Override
    protected RepositoryImpl createRepository() throws IOException {

        try {
            final RepositoryConfig config = createRepositoryConfiguration();
            return RepositoryImpl.create(config);
        } catch (final ConfigurationException e) {
            LOG.error("Configuration invalid", e);
            throw new AssertionError(e.getMessage(), e);
        } catch (RepositoryException e) {
            LOG.error("Could not create repository", e);
            throw new AssertionError(e.getMessage(), e);
        }
    }
1229303
public QueryResult execute() throws RepositoryException
   {
      checkInitialized();
      long time = 0;
      if (log.isDebugEnabled())
      {
         time = System.currentTimeMillis();
      }

      QueryResult result = query.execute(offset, limit, caseInsensitiveOrder);

      if (log.isDebugEnabled())
      {
         time = System.currentTimeMillis() - time;
         NumberFormat format = NumberFormat.getNumberInstance();
         format.setMinimumFractionDigits(2);
         format.setMaximumFractionDigits(2);
         String seconds = format.format((double)time / 1000);
         log.debug("executed in " + seconds + " s. (" + statement + ")");
      }
      return result;
   }
35668
public function find(array $filter = [], array $orderBy = [], $limit = 0,
        $offset = 0, array $associate = []
    ) {
        try {

            $query = $this->query()
                ->select()
                ->associate($associate)
                ->setFilter($filter);

            foreach ($orderBy as $orderByRule) {
                $query->orderBy($orderByRule[0], $orderByRule[1]);
            }

            return $query->limit($limit)->offset($offset)->run($this->connection);
        } catch (Exception\QueryException $e) {
            throw new Exception\RepositoryException($e->getMessage());
        }
    }
1334752
public ManageableRepository getRepository(String name) throws RepositoryException
   {
      RepositoryContainer repositoryContainer = repositoryContainers.get(name);
      log.debug("RepositoryServiceimpl() getRepository " + name);
      if (repositoryContainer == null)
      {
         throw new RepositoryException("Repository '" + name + "' not found.");
      }

      return (ManageableRepository)repositoryContainer.getComponentInstanceOfType(ManageableRepository.class);
   }
702241
public function setRepository(DocumentRepository $repository)
    {
        $this->repository = $repository;
        $this->manager = $repository->getDocumentManager();
        return $this;
    }
912181
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException {
        return visitor.visit(this, data);
    }
293452
public function where($condition, $parameters = array()) {
		if ($this->selection)
			$this->selection->where($condition, $parameters);
		else
			throw new RepositoryException("Before using the function where(...) call read(...).");
		return $this;
	}
32562
public function order($columns) {
		if ($this->selection)
			$this->selection->order($columns);
		else
			throw new RepositoryException("Before using the function order(...) call read(...).");
		return $this;
	}
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;
    }
1080377
public synchronized final void initialize() throws RepositoryException {
        if (!initialized) {
            try {
                doInitialize();
                initialized = true;
            } catch (RuntimeException e) {
                throw new RepositoryException(e);
            }
        }
    }
577198
public function getRepository(string $name): RepositoryInterface
    {
        if (isset($this->repositories[$name])) {
            return $this->repositories[$name];
        }

        throw new \LogicException(sprintf('Unknown repository "%s"', $name));
    }
969997
protected function getQueryBuilder($repositoryMethod)
    {
        $repository = $this
            ->getDriver()
            ->getDoctrineOrmEm()
            ->getRepository($this->getDriver()->getEntityFqn())
        ;

        $repositoryMethods = $this->getDriver()->getEntityRepositorySearchableMethods();

        if (!method_exists($repository, $repositoryMethods[$repositoryMethod])) {
            return $repository->createQueryBuilder($this->getDriver()->getEntityAlias());
        }

        $queryBuilder = $repository->{$repositoryMethods[$repositoryMethod]}();

        if (!$queryBuilder instanceof QueryBuilder) {
            throw new ResourceException(sprintf(
                'The method "%s" of repository class must be return a %s instance',
                $repositoryMethods[$repositoryMethod],
                '\Doctrine\ORM\QueryBuilder'
            ));
        }

        return $queryBuilder;
    }