Add comment.

@param Comment $comment
334512
public function addComment(Comment $comment)
    {
        if (!$this->comments->contains($comment)) {
            $this->comments->add($comment);
        }
    }
907736
def add_comment(self, comment):
        
        if not comment:
            return

        self.__comments[comment.name] = comment
        self.comment_added_signal(self, comment)
1279462
public function addComment($comment)
    {
        $comment->setPaymentId($this->getPaymentId());
        $comment->save();

        $this->load($this->getPaymentId());

        return $comment;
    }
687787
public static function add_comment(comment $comment) {
        global $DB;
        $comment->id = null;
        return $DB->insert_record('assignfeedback_editpdf_cmnt', $comment);
    }
414424
public function comment($comment = null) {
		if ($comment) {
			$this->_config['comment'] = $comment;
			return $this;
		}
		return $this->_config['comment'];
	}
1084355
public function addComment(\Innova\CollecticielBundle\Entity\CommentRead $comments)
    {
        $this->comments[] = $comments;

        return $this;
    }
547571
protected function addSection($comment, \splFileObject $file)
    {
        $section = new Section($comment, $file);
        $this->sections[$section->getReference(true)] = $section;
        $this->sectionsSortedByReference = false;
    }
1236139
public function addCommentOnColumn($table, $column, $comment)
    {
        $table = $this->db->quoteTableName($table);
        $column = $this->db->quoteColumnName($column);
        $comment = $this->db->quoteValue($comment);

        $this->execute("COMMENT ON COLUMN $table.$column IS $comment;");
    }
620907
public function removeComment(Comment $comment)
    {
        if ($this->comments->contains($comment)) {
            $this->comments->removeElement($comment);
        }
    }
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;
  }
355733
public function addComment(\Innova\CollecticielBundle\Entity\Comment $comments)
    {
        $this->comments[] = $comments;

        return $this;
    }
1074207
public function update(Comment &$comment)
    {
        $data = $comment->exportData();
        $endpoint = '/admin/comments/'.$comment->id.'.json';
        $response = $this->request(
            $endpoint, 'PUT', array(
            'comment' => $data
            )
        );
        $comment->setData($response['comment']);
    }
794426
public static function add_comment($commenttext, $width, $colour) {
        global $DB, $USER;

        $comment = new \stdClass();
        $comment->userid = $USER->id;
        $comment->rawtext = $commenttext;
        $comment->width = $width;
        $comment->colour = $colour;

        $comment->id = $DB->insert_record('assignfeedback_editpdf_quick', $comment);
        return $comment;
    }
614335
protected function setComment($comment)
    {
        $this->desc    = '';
        $this->tags    = [];
        $this->comment = $comment;

        $this->parseComment($comment);
    }
1371053
public function update(Request $request, Comment $comment)
    {
        $this->authorize('edit-comment', $comment);

        $this->validate($request, [
            'message' => 'required|string'
        ]);

        $comment->update([
            'comment' => $request->message
        ]);

        return redirect()->to(url()->previous() . '#comment-' . $comment->id);
    }
181093
private function updateFromPostCache(Comment $comment, $c)
    {
        if ($comment->postId == null)
        {
            return;
        }
        if ($this->postCache == null || $this->postCache['ID'] != $comment->postId)
        {
            $this->postCache = $this->adminApi->getPost($comment->postId);
        }

        $comment->date = $this->getMetaKeyValue($this->postCache, "linkoscope_created_$comment->id") ?: $c['date'];
        $comment->score =
            $this->getMetaKeyValue($this->postCache, "linkoscope_score_$comment->id") ?: strtotime($c['date']);
    }
886630
public function dispatchCommentOnAddEvent(CommentInterface $comment)
    {
        $event = new CommentOnAddEvent(
            $comment
        );

        $this
            ->eventDispatcher
            ->dispatch(ElcodiCommentEvents::COMMENT_ONADD, $event);

        return $this;
    }