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;
    }