PostController::editComment PHP Method

editComment() public method

Will throw an error if both params are blank.
Since: 2.0.0
public editComment ( integer $CommentID = '', integer $DraftID = '' )
$CommentID integer Unique ID of the comment to edit.
$DraftID integer Unique ID of the draft to edit.
    public function editComment($CommentID = '', $DraftID = '')
    {
        if (is_numeric($CommentID) && $CommentID > 0) {
            $this->Form->setModel($this->CommentModel);
            $this->Comment = $this->CommentModel->getID($CommentID);
        } else {
            $this->Form->setModel($this->DraftModel);
            $this->Comment = $this->DraftModel->getID($DraftID);
        }
        if (c('Garden.ForceInputFormatter')) {
            $this->Form->removeFormValue('Format');
        }
        $this->View = 'editcomment';
        $this->Comment($this->Comment->DiscussionID);
    }