protected function getEntityName()
    {
        if ($this->entityName === null) {
            $name = $this->entityClass;

            if (false !== $pos = strrpos($name, '\\')) {
                $name = substr($name, $pos + 1);
            }
            $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $name));
            $name = str_replace('-', '_', $name);
            $this->entityName = $name;
        }

        return $this->entityName;
    }