public function getContentObject($contenttype, $values = [], $isRootType = true)
    {
        // Make sure $contenttype is an array, and not just the slug.
        if (!is_array($contenttype)) {
            $contenttype = $this->getContentType($contenttype);
        }

        // If the contenttype has a 'class' specified, and the class exists,
        // Initialize the content as an object of that class.
        if (!empty($contenttype['class']) && class_exists($contenttype['class'])) {
            $content = new $contenttype['class']($this->app, $contenttype, $values, $isRootType);

            // Check if the class actually extends \Bolt\Legacy\Content.
            if (!($content instanceof Content)) {
                throw new \Exception($contenttype['class'] . ' does not extend \\Bolt\\Legacy\\Content.');
            }
        } else {
            $content = new Content($this->app, $contenttype, $values, $isRootType);
        }

        return $content;
    }
public function getContentObject($contenttype, $values = [], $isRootType = true)
    {
        // Make sure $contenttype is an array, and not just the slug.
        if (!is_array($contenttype)) {
            $contenttype = $this->getContentType($contenttype);
        }

        // If the contenttype has a 'class' specified, and the class exists,
        // Initialize the content as an object of that class.
        if (!empty($contenttype['class']) && class_exists($contenttype['class'])) {
            $content = new $contenttype['class']($this->app, $contenttype, $values, $isRootType);

            // Check if the class actually extends \Bolt\Legacy\Content.
            if (!($content instanceof Content)) {
                throw new \Exception($contenttype['class'] . ' does not extend \\Bolt\\Legacy\\Content.');
            }
        } else {
            $content = new Content($this->app, $contenttype, $values, $isRootType);
        }

        return $content;
    }
public function getContentObject ( $ contenttype , $ values = [ ] , $ isRootType = true ) { // Make sure $contenttype is an array, and not just the slug. if ( ! is_array ( $ contenttype ) ) { $ contenttype = $ this -> getContentType ( $ contenttype ) ; } // If the contenttype has a 'class' specified, and the class exists, // Initialize the content as an object of that class. if ( ! empty ( $ contenttype [ 'class' ] ) && class_exists ( $ contenttype [ 'class' ] ) ) { $ content = new $ contenttype [ 'class' ] ( $ this -> app , $ contenttype , $ values , $ isRootType ) ; // Check if the class actually extends \Bolt\Legacy\Content. if ( ! ( $ content instanceof Content ) ) { throw new \ Exception ( $ contenttype [ 'class' ] . ' does not extend \\Bolt\\Legacy\\Content.' ) ; } } else { $ content = new Content ( $ this -> app , $ contenttype , $ values , $ isRootType ) ; } return $ content ; }
Get an object for the content of a specific contenttype. This will be
\Bolt\Legacy\Content, unless the contenttype defined another class to be
used.

@param array|string $contenttype
@param array        $values
@param bool         $isRootType

@throws \Exception

@return \Bolt\Legacy\Content
Get an object for the content of a specific contenttype . This will be \ Bolt \ Legacy \ Content unless the contenttype defined another class to be used .