protected function getIdentifier($entity)
    {
        $entityId = json_decode($this->entityRegistry->getEntityId($entity), true);

        if (is_array($entityId)) {
            $identifier = [];

            foreach ($entityId as $key => $value) {
                $key              = strtolower(Normalise::toUnderscoreSeparated(Normalise::fromCamelCase($key)));
                $identifier[$key] = $value;
            }

            return $identifier;
        }

        $primary = $this->builder->getMeta(get_class($entity))->primary;

        return [$primary => $entityId];
    }