Create a new comment

@link   https://help.shopify.com/api/reference/comment#create
@param  Comment $comment
@return void
543351
public function create(Comment &$comment)
    {
        $data = $comment->exportData();
        $endpoint = '/admin/comments.json';
        $respoinse = $this->request(
            $endpoint, 'POST', array(
            'comment' => $data
            )
        );
        $comment->setData($response['comment']);
    }
393735
public function addComment($orderIncrementId, $status, $comment = null, $notify = null)
    {
        return $this->__createAction('salesOrderAddComment', func_get_args());
    }
700087
public function destroy(Comment $comment)
    {
        $this->authorize('delete-comment', $comment);

        $comment->delete();

        return redirect()->back();
    }
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']);
    }
1147304
def add_comment(self, comment, metadata=""):
        
        data = {
            'comment': comment,
            'metadata': metadata
        }

        return self.post('createComment', data)
793898
public function comment(string $comment = ''): Writer
    {
        $comment = trim($comment);

        if (!empty($comment)) {
            $comment = ' ' . $comment;
        }

        return $this->line(trim('#' . $comment));
    }
195839
public function setComment($comment)
    {
        if (($comment !== null) && !is_string($comment)) {
            throw SchemaException::invalidColumnComment($this->getName());
        }

        $this->comment = $comment;
    }
227699
public function createComment(Blog $blog, Post $post, Comment $comment, $forcePublication = false)
    {
        $published = false;
        if ($blog->isAutoPublishComment()
            || $forcePublication
            || (BlogOptions::COMMENT_MODERATION_PRIOR_ONCE === $blog->getOptions()->getCommentModerationMode()
                && null !== $comment->getAuthor()
                && count($this->memberRepo->getTrustedMember($blog, $comment->getAuthor())) >= 1)) {
            $published = true;
        }

        $comment
            ->setPost($post)
            ->setStatus($published ? Comment::STATUS_PUBLISHED : Comment::STATUS_UNPUBLISHED);

        if (null === $comment->getCreationDate()) {
            $comment->setCreationDate(new \DateTime());
        }

        $this->om->persist($comment);
        $this->om->flush();

        $this->trackingManager->dispatchCommentCreateEvent($post, $comment);

        if (null !== $comment->getAuthor()) {
            $this->trackingManager->updateResourceTracking($blog->getResourceNode(), $comment->getAuthor(), new \DateTime());
        }

        return $comment;
    }
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);
  }
251162
public function edit(Comment $comment)
    {
        $this->authorize($comment);

        pageinfo([
            'title' => __('comments.edit_page'),
            'robots' => 'noindex,follow',
        ]);

        return $this->makeResponse('edit', compact('comment'));
    }
1249203
public function update(CommentRequest $request, Comment $comment)
    {
        try {
            $attributes = $request->all();

            $comment->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('news::comment.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('news/comment/' . $comment->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('news/comment/' . $comment->getRouteKey()))
                ->redirect();
        }

    }
1255204
public function removeComment(Comment $comment)
    {
        if ($this->comments->contains($comment)) {
            $this->comments->removeElement($comment);
            $comment->setTask(null);
        }

        return $this;
    }
1019758
public function addComment(string $comment) : TomlBuilder
    {
        $this->append($this->dumpComment($comment), true);

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

        return $this;
    }
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;
  }
866092
public function spam(Comment &$comment)
    {
        $endpoint = '/admin/comments/'.$comment->id.'/spam.json';
        $response = $this->request($endpoint, 'POST');
        $comment->setData($response['comment']);
    }
327311
public function addComment($creditmemoIncrementId, $comment = null, $notifyCustomer = null, $includeComment = null)
    {
        return $this->__createAction('order_creditmemo.addComment', func_get_args());
    }