public function getCachePrefix()
    {
        if ($this->cachePrefix) {
            return $this->cachePrefix;
        }

        $class = $this->getClassName();

        if (!in_array(TaggedEntityInterface::class, class_implements($class))) {
            throw new \RuntimeException(sprintf(
                'The entity %s does not implements %s, query should not be cached.',
                $class, TaggedEntityInterface::class
            ));
        }

        return $this->cachePrefix = call_user_func([$this->getClassName(), 'getEntityTagPrefix']);
    }