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;
    }
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;
    }
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 ; }
Returns a new empty entity class.

@param object|null $entity

@throws \Bolt\Exception\StorageException

@return object
Returns a new empty entity class .