public function getRepository(string $entity): Repository
    {
        if (isset($this->repositories[$entity])) {
            return $this->repositories[$entity];
        }

        /** @var Entity|string $entity */
        $repository = $entity::getRepository() ?? PDORepository::class;

        return $this->repositories[$entity] = new $repository($this, $entity, $entity::getTable());
    }