Add a repository definition to the pool

@param RepositoryDefinitionInterface $repositoryDefinition
@throws DomainErrorException
555868
public function addRepositoryDefinition(RepositoryDefinitionInterface $repositoryDefinition)
    {
        $slug = $repositoryDefinition->getSlug();

        if (isset($this->repositoriesBySlug[$slug])) {
            throw new DomainErrorException('Two repositories has the same "'.$slug.'" slug!');
        }

        $this->repositoriesBySlug[$slug] = $repositoryDefinition;
    }
1015456
public function delete(int $identifier): void
    {
        try {
            $this->deleteResource($identifier);
        } catch (RepositoryException $exception) {
            $message = 'Client redirect URI deletion failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
227827
public function setDefinition($reportDefinition)
    {
        if ($reportDefinition instanceof ReportDefinitionBuilder) {
            $reportDefinition = $reportDefinition->build();
        }

        $this->definition = $reportDefinition;

        return $this;
    }
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;
    }
1318091
def add_repository(self, name, repository_type, repository_class,
                       aggregate_class, make_default, configuration):
        
        repo_mgr = self.get_registered_utility(IRepositoryManager)
        if name is None:
            # If no name was given, this is assumed to be the ROOT repository
            # for the given repository type.
            name = REPOSITORY_DOMAINS.ROOT
        repo = repo_mgr.new(repository_type, name=name,
                            make_default=make_default,
                            repository_class=repository_class,
                            aggregate_class=aggregate_class,
                            configuration=configuration)
        repo_mgr.set(repo)
1251066
public function bindScopeIdentifiers(string $identifier, iterable $scopeIdentifiers): void
    {
        try {
            $schema = $this->getDatabaseSchema();
            $this->createBelongsToManyRelationship(
                $identifier,
                $scopeIdentifiers,
                $schema->getClientsScopesTable(),
                $schema->getClientsScopesClientIdentityColumn(),
                $schema->getClientsScopesScopeIdentityColumn()
            );
        } catch (RepositoryException $exception) {
            $message = 'Binding client scopes failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
509960
public function setUp(
        $entityClass,
        array $entityProperties,
        $collectionClass,
        RepositoryInterface $entityRepository = null
    ) {
        @trigger_error(__METHOD__.'() is deprecated and will be removed in 2.0. Please use configureMetadata() instead.', E_USER_DEPRECATED);

        if ($entityRepository) {
            @trigger_error('Repository injection throught '.__METHOD__.'() is deprecated and will be removed in 2.0. Please inject it by constructor.', E_USER_DEPRECATED);

            $this->entityRepository = $entityRepository;
        }

        return $this->configureMetadata($entityClass, $entityProperties, $collectionClass);
    }
194866
public void addCrudService(Class clazz, BundleContext bundleContext, JcrRepository repository) throws RepositoryException {
        jcrom.map(clazz);
        JcrCrudService<? extends Object> jcromCrudService;
        jcromCrudService = new JcrCrudService<>(repository, jcrom, clazz);
        crudServiceRegistrations.put(jcromCrudService, registerCrud(bundleContext, jcromCrudService));
    }
17115
public final void addRemoteRepository(String id, String type, String url) {
        if (this.repositoryIds.add(id) ) {
            getRemoteRepositories().add(new RemoteRepository(id, type, url));
        }
    }
1327950
public function setRepositoryReference(RepositoryReference $repositoryReference)
    {
        parent::setRepositoryReference($repositoryReference);
        $this
            ->repository
            ->setRepositoryReference($repositoryReference);
    }
431076
public function addPolicyDefinition(PolicyDefinition $definition)
  {
    // Do not include excluded dependencies
    if (!in_array($definition->getName(), $this->excludedPolicies)) {
      $this->policies[$definition->getName()] = $definition;
    }
    return $this;
  }
893038
private function generateRepository($className) {
		$table = EntityReflexion::getTable($className);
		if ($table === NULL) {
			throw new RepositoryException("Entity \"" . $className . " has no annotation \"table\"");
		} else {
			$genClassName = $this->generateRepositoryName($className);
			if (!class_exists($genClassName)) {
				$class = $this->cache->load($genClassName);
				if ($class) {
					$repository = $class;
				} else {
					$repository = new ClassType($genClassName);
					$repository->addExtend('\slimORM\BaseRepository');
					$repository->setFinal(TRUE);
					$repository->addComment($genClassName);
					$repository->addComment("@generated");
					$repository->addProperty("connection")
						->setVisibility("protected")
						->addComment('@var \Nette\Database\Context');
					$repository->addProperty("entityManager")
						->setVisibility("protected")
						->addComment('@var \slimORM\EntityManager');
					$parameter = new Parameter("connection");
					$parameter->setTypeHint('\Nette\Database\Context');
					$parameter2 = new Parameter("entityManager");
					$parameter2->setTypeHint('\slimORM\EntityManager');
					$entity = EntityManager::PREFIX . str_replace("\\", "", $className) . "Entity";
					$repository->addMethod("__construct")
						->addComment($genClassName . " constructor")
						->addComment('@param \Nette\Database\Context $connection')
						->addComment('@param \slimORM\EntityManager $entityManager')
						->setParameters(array($parameter, $parameter2))
						->setBody("\$this->connection = \$connection;\n\$this->entityManager = \$entityManager;\nparent::__construct(\$connection, \"$table\", \"$entity\");");
					$parameter = new Parameter("key");
					$repository->addMethod("get")
						->addComment("Find item by primary key")
						->addComment("@param int \$key")
						->addComment("@return $entity|null")
						->setParameters(array($parameter))
						->setBody("return parent::get(\$key);");

					//FileSystem::write(WWW_DIR . '/temp/' . $genClassName . ".php", "<?php\n" . $repository);
					$this->cache->save($genClassName, $repository, array(
						Cache::FILES => EntityReflexion::getFile($className), // lze uvést i pole souborů
					));
				}
				$res = eval('?><?php ' . $repository);
				if ($res === FALSE && ($error = error_get_last()) && $error['type'] === E_PARSE) {
					throw new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
				}
				$this->repositories[$genClassName] = new $genClassName($this->connection, $this);
			} else if (!isset($this->repositories[$genClassName])) {
				$this->repositories[$genClassName] = new $genClassName($this->connection, $this);
			}
		}
	}
362248
public function setCustomRepositoryClass(?string $repositoryClassName) : void
    {
        if ($this->isEmbeddedDocument || $this->isQueryResultDocument) {
            return;
        }

        $this->customRepositoryClassName = $repositoryClassName;
    }
199618
public function add(DefinitionInterface $definition): Endpoint
    {
        if ($definition instanceof MutationDefinition) {
            return $this->addMutation($definition);
        }

        if ($definition instanceof QueryDefinition) {
            return $this->addQuery($definition);
        }

        return $this->addType($definition);
    }
1111800
private function createRepository(EntityManagerInterface $entityManager, $entityName)
    {
        /** @var ClassMetadata $metadata */
        $metadata            = $entityManager->getClassMetadata($entityName);
        $repositoryClassName = $metadata->getCustomRepositoryClassName()
            ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName();

        return new $repositoryClassName($entityManager, $metadata);
    }
167846
public function setDefaultRepositoryClassName(string $repositoryClassName) : void
    {
        $reflectionClass = new ReflectionClass($repositoryClassName);

        if (! $reflectionClass->implementsInterface(ObjectRepository::class)) {
            throw InvalidEntityRepository::fromClassName($repositoryClassName);
        }

        $this->defaultRepositoryClassName = $repositoryClassName;
    }
560992
protected function defineEntity(ClassDefinition $class)
    {
        $class->property($this->name)->asString();

        $class->property($this->slug)->asString();

        $class->property($this->role)->asString();

        $class->property($this->bio)->asObject(Html::class);

        $class->property($this->articles)->asType(BlogArticle::collectionType());

        $this->defineMetadata($class);
    }