Add a new comment.

@param array $comment with all details.

@return void
509514
public function add($comment)
    {
        $comments = $this->session->get('comments', []);
        $comments[] = $comment;
        $this->session->set('comments', $comments);
    }
687787
public static function add_comment(comment $comment) {
        global $DB;
        $comment->id = null;
        return $DB->insert_record('assignfeedback_editpdf_cmnt', $comment);
    }
1152252
public function addAttributes(array $attributes)
	{
		foreach($attributes as $attrName => $attrValue) {
			$this->addAttribute($attrName, $attrValue);
		}
	}
1019758
public function addComment(string $comment) : TomlBuilder
    {
        $this->append($this->dumpComment($comment), true);

        return $this;
    }
1355582
public function fillObject( $comment, $fieldNames = null )
    {
        $filledFields = $this->fields;
        if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
        {
            $filledFields = array();
            foreach ( $fieldNames as $fieldName )
            {
                $filledFields[$fieldName] = $this->fields[$fieldName];
            }
        }
        foreach ( $filledFields as $field => $fieldSetup )
        {
            $attributeName = $fieldSetup[self::ATTRIBUTENAME];
            if ( !is_null( $attributeName ) )
            {
                $fieldValue = $this->fieldValues[$field];
                $comment->setAttribute( $attributeName, $fieldValue );
            }
        }
    }
38519
public static function create($comment) {
    $block_comment = new LineCommentBlockNode();
    $comment = trim($comment);
    $lines = array_map('rtrim', explode("\n", $comment));
    foreach ($lines as $line) {
      $comment_node = new CommentNode(T_COMMENT, '// ' . $line . "\n");
      $block_comment->addChild($comment_node);
    }
    return $block_comment;
  }
153538
private function initComment($comment)
    {
        if (empty($this->docComment)) {
            $this->docComment = new Comment();
        }

        $this->setComment($comment);
    }
870810
public function setComment(\Haven\CmsBundle\Entity\Comment $comment = null)
    {
        $this->comment = $comment;

        return $this;
    }
1195776
protected function handleComment(array $token)
    {

        $node = $this->createNode('comment', $token);
        $node->rendered = $token['rendered'];

        $this->current = $node;
    }
329316
public function addComment(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Comment\Comment $comment)
    {
        $this->comments[] = $comment;

        return $this;
    }
1208842
protected function appendComment($comment)
    {
        $comment[1] = substr(preg_replace(['/^\s+/m', '/^(.)/m'], ['', ' \1'], $comment[1]), 1);

        $this->env->comments[] = $comment;
    }
120115
public function updateComment()
    {
        $newComment = $_POST['comment'] ?? null;
        $commentId = $_POST['commentId'] ?? null;

        if (!$newComment || !$commentId || !$comment = get_comment($commentId)) {
            wp_send_json_error('Missing variables');
        }

        if (!current_user_can('edit_comment', $comment->comment_ID) && !($comment->user_id == get_current_user_id())) {
            wp_send_json_error('Missing authorization');
        }

        // Validate nonce
        if (!check_ajax_referer("update-comment_$comment->comment_ID", 'nonce', false)) {
            wp_send_json_error('Nonce failed');
        }

        $comment->comment_content = $newComment;
        if (wp_update_comment((array) $comment)) {
            wp_send_json_success('Update was successful');
        }

        wp_send_json();
    }
355733
public function addComment(\Innova\CollecticielBundle\Entity\Comment $comments)
    {
        $this->comments[] = $comments;

        return $this;
    }
1050744
public static function create($comment) {
    $comment = trim($comment);
    $lines = array_map('trim', explode("\n", $comment));
    $text = "/**\n";
    foreach ($lines as $i => $line) {
      $text .= ' * ' . $line . "\n";
    }
    $text .= ' */';
    return new DocCommentNode(T_DOC_COMMENT, $text);
  }
127175
public function setComment($comment)
    {
        $returnValue = (bool) false;
        $this->removePropertyValues($this->getProperty(OntologyRdfs::RDFS_COMMENT));
        $this->setPropertyValue($this->getProperty(OntologyRdfs::RDFS_COMMENT), $comment);
        $this->comment = $comment;
        return (bool) $returnValue;
    }
1058097
public function renderHeader(array $comments = []) : void
    {
        if ($this->isSilent()) {
            return;
        }

        $this->logger->debug('rendering comments');

        foreach ($comments as $comment) {
            fwrite($this->file, ';;; ' . $comment . PHP_EOL);
        }

        fwrite($this->file, PHP_EOL);
    }
824694
public function addCommentAbove($comment) {
    if ($comment instanceof LineCommentBlockNode) {
      $this->before($comment);
    }
    elseif (is_string($comment)) {
      $this->addCommentAbove(LineCommentBlockNode::create($comment));
    }
    else {
      throw new \InvalidArgumentException();
    }
    return $this;
  }