public function getValueByKey($key, $default = '', $class = null)
    {
        if (null === $class) {
            $class = $this->getEntityClass();
        }

        $result = $this->getDoctrine()->getRepository($class)->findOneBy(
            [
                'key' => $key,
            ]
        );

        if (null === $result) {
            return $default;
        }

        return $result->getValue();
    }