public function getBySlug($slug)
    {
        if (! isset($this->entitiesBySlug[$slug])) {
            throw new DomainErrorException('Unable to find entity for slug '.$slug.'!');
        }

        return $this->entitiesBySlug[$slug];
    }