public function getEntity($entity = null)
    {
        if ($entity === null) {
            $class = $this->class;
            $entity = new $class();
        }

        if ($entity instanceof Content && !$entity->getContenttype() && $ct = $this->getClassMetadata()->getBoltName()) {
            $contentType = $this->metadata->createContentType($ct);
            if ($contentType) {
                $entity->setContenttype($contentType);
            } else {
                $entity->setContenttype($ct);
            }
        }

        return $entity;
    }