Remove comment

@param \Haven\CmsBundle\Entity\Comment $comment
177962
public function removeComment(\Haven\CmsBundle\Entity\Comment $comment)
    {
        $this->comments->removeElement($comment);
    }
840681
public function removeReply(\BisonLab\SakonninBundle\Entity\Message $replies)
    {
        $this->replies->removeElement($replies);
    }
131079
public function remove(string $comment, array $params = [])
    {
        $path = $this->buildCommentsPath($comment);

        return $this->delete($path, $params);
    }
507028
def remove_comment(self, topic_id, comment_id, reason='0', other=None):
        
        params = {'cid': comment_id}
        data = {'cid': comment_id, 'ck': self.api.ck(), 'reason': reason, 'other': other, 'submit': '确定'}
        r = self.api.req(API_GROUP_REMOVE_COMMENT % topic_id, 'post', params, data)
        if r.text.find('douban_admin') > -1:
            r = self.api.req(API_GROUP_ADMIN_REMOVE_COMMENT % topic_id, 'post', params, data)
        self.api.logger.debug('remove comment final url is <%s>' % r.url)
        return r
700087
public function destroy(Comment $comment)
    {
        $this->authorize('delete-comment', $comment);

        $comment->delete();

        return redirect()->back();
    }
1303783
public function addComment($user, string $comment) : Comment
    {
        return $this->comments()->create([
            'user_id' => $user->id,
            'comment' => $comment,
        ]);
    }
1374612
protected function outputComment($comment)
	{
		if ($this->commentOptions instanceof \Closure) {
			$options = call_user_func($this->commentOptions, $comment);
		} else {
			$options = $this->commentOptions;
		}
		$options = ArrayHelper::merge($options, ['data-comment-id'=>$comment->id]);
		if ($this->useBootstrapClasses) Html::addCssClass($options, 'media');

		//render comment
		echo Html::beginTag('div', $options);

			//body
			$wrapperOptions = ['class'=>'comment-wrapper'];
			if ($this->useBootstrapClasses) Html::addCssClass($wrapperOptions, 'media-body');
			echo Html::beginTag('div', $wrapperOptions);

				//title
				if (!empty($comment->title)) {
					$titleOptions = ['class'=>'comment-title'];
					if ($this->useBootstrapClasses) Html::addCssClass($titleOptions, 'media-heading');
					$title = $this->encodeCommentTitle ? Html::encode($comment->title) : $comment->title;
					echo Html::tag($this->commentTitleTag, $title, $titleOptions);
				}

				//content
				$content = $this->encodeCommentContents ? Html::encode($comment->content) : $comment->content;
				echo Html::tag('div', $content, ['class'=>'comment-content']);

				//meta
				echo Html::beginTag('dl', ['class'=>'comment-meta']);
				echo Html::tag('dt', Yii::t('app', 'Created'));
				echo Html::tag('dd', Yii::$app->formatter->asDatetime($comment->created));
				if (!empty($comment->updated) && $comment->updated != $comment->created) {
					echo Html::tag('dt', Yii::t('app', 'Updated'));
					echo Html::tag('dd', Yii::$app->formatter->asDatetime($comment->updated));
				}
				if (!empty($comment->user_id)) {
					$author = $this->authorCallback === null ? $comment->created_by : call_user_func($this->authorCallback, $comment->created_by);
					echo Html::tag('dt', Yii::t('app', 'Author'));
					echo Html::tag('dd', $author);
				}
				echo Html::endTag('dl');

			echo Html::endTag('div');
		echo Html::endTag('div');
	}
620907
public function removeComment(Comment $comment)
    {
        if ($this->comments->contains($comment)) {
            $this->comments->removeElement($comment);
        }
    }
1137578
public function dispatchCommentPreRemoveEvent(CommentInterface $comment)
    {
        $event = new CommentPreRemoveEvent(
            $comment
        );

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

        return $this;
    }
888687
public function sanitizeComments($comments)
    {
        $sanitizers = $this->_comment_sanitizer;

        if (isset($sanitizers['format'])) {
            $sanitizers['format'] = $this->_repository
                                         ->getValidator()
                                         ->getFilter($sanitizers['format']);
        }

        foreach ($comments as $comment) {
            $comment->sanitizeData('body', $sanitizers);
        }
    }
874917
public function removeComment(ResourceComment $comment)
    {
        if ($this->comments->contains($comment)) {
            $this->comments->removeElement($comment);
        }
    }
251162
public function edit(Comment $comment)
    {
        $this->authorize($comment);

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

        return $this->makeResponse('edit', compact('comment'));
    }
331523
public static function removeComments($output)
    {
        $lines  = explode("\n", $output);
        $output = "";
        // try to keep mem. use down
        $linecount  = count($lines);
        $in_comment = false;
        for ($i=0; $i<$linecount; $i++) {
            if (preg_match("/^\/\*/", $lines[$i])) {
                $in_comment = true;
            }
            if (!$in_comment) {
                $output .= $lines[$i] . "\n";
            }
            if (preg_match("/\*\/$/", $lines[$i])) {
                $in_comment = false;
            }
        }
        unset($lines);
        return $output;
    }
494346
private static function remove_decorations( $comment ) {
		$comment = preg_replace( '|^/\*\*[\r\n]+|', '', $comment );
		$comment = preg_replace( '|\n[\t ]*\*/$|', '', $comment );
		$comment = preg_replace( '|^[\t ]*\* ?|m', '', $comment );

		return $comment;
	}
414424
public function comment($comment = null) {
		if ($comment) {
			$this->_config['comment'] = $comment;
			return $this;
		}
		return $this->_config['comment'];
	}
814047
public function setComment(string $comment): void
    {
        $this->desc = '';
        $this->tags = [];
        $this->comment = $comment;

        $this->parseComment($comment);
    }
121636
public function setComment($comment)
    {
        if ( ! is_string($comment))
        {
            throw new InvalidArgumentException(
                'Expected a string, but got '.gettype($comment)
            );
        }

        $this->comment = $comment;
    }