src/Models/Comment.php
public static function create($comment)
    {
        // If numeric, create the comment
        if (is_numeric($comment)) {
            // Retrieve the transient
            $transientKey = sprintf('WPMVC\Models\Comment(%d)', $comment);
            $storedData = get_transient($transientKey);
            // If the transient doesn't yet exist, query for it!
            if ($storedData === false) {
                // Retrieve the comment object
                $comment = get_comment(intval($comment));
                // Store the transient
                set_transient($transientKey, $comment, $this->transientTimeout);
            } else {
                $comment = $storedData;
            }
        } elseif (is_array($comment)) {
            // Convert array into object
            $comment = (object) $comment;
        }
        return new static($comment);
    }
public static function create($comment)
    {
        // If numeric, create the comment
        if (is_numeric($comment)) {
            // Retrieve the transient
            $transientKey = sprintf('WPMVC\Models\Comment(%d)', $comment);
            $storedData = get_transient($transientKey);
            // If the transient doesn't yet exist, query for it!
            if ($storedData === false) {
                // Retrieve the comment object
                $comment = get_comment(intval($comment));
                // Store the transient
                set_transient($transientKey, $comment, $this->transientTimeout);
            } else {
                $comment = $storedData;
            }
        } elseif (is_array($comment)) {
            // Convert array into object
            $comment = (object) $comment;
        }
        return new static($comment);
    }
public static function create ( $ comment ) { // If numeric, create the comment if ( is_numeric ( $ comment ) ) { // Retrieve the transient $ transientKey = sprintf ( 'WPMVC\Models\Comment(%d)' , $ comment ) ; $ storedData = get_transient ( $ transientKey ) ; // If the transient doesn't yet exist, query for it! if ( $ storedData === false ) { // Retrieve the comment object $ comment = get_comment ( intval ( $ comment ) ) ; // Store the transient set_transient ( $ transientKey , $ comment , $ this -> transientTimeout ) ; } else { $ comment = $ storedData ; } } elseif ( is_array ( $ comment ) ) { // Convert array into object $ comment = ( object ) $ comment ; } return new static ( $ comment ) ; }
Creates a new instance by the comment ID

@access public
@param array|int $comment
@return static
Creates a new instance by the comment ID