Удаление объекта.

@param CommentsServiceContract $commentsService
@param int $id

@return DestroyResponseContract
510277
public function destroy(CommentsServiceContract $commentsService, int $id = 0): DestroyResponseContract
    {
        $result = $commentsService->destroy($id);

        return app()->makeWith(DestroyResponseContract::class, [
            'result' => (!! $result),
        ]);
    }
1074003
public function deleteComment(int $id): bool
    {
        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id',
            $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id), Request::METHOD_DELETE);

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return false;
    }
133231
public function removeComment($id, $commentId)
    {
        return $this->delete($this->getPath($id).'/comments/'.rawurlencode($commentId));
    }
1349733
function comment_destroy_batch( $ids )
	{
		$params = array();
		if (is_array($ids) && !empty($ids)) {
			foreach($ids as $k => $v) {
				$this->id_format($ids[$k]);
			}
			$params['cids'] = join(',', $ids);
		} else {
			$params['cids'] = $ids;
		}
		return $this->oauth->post( 'comments/destroy_batch', $params);
	}
492296
public function destroy($id)
    {
        try {
            $result = $this->service->destroy(Auth::user(), $id);

            if ($result) {
                return redirect('teams')->with('message', 'Successfully deleted');
            }

            return redirect('teams')->with('message', 'Failed to delete');
        } catch (Exception $e) {
            return back()->withErrors($e->getMessage());
        }
    }
822762
public function destroy($id)
    {
        return $this->client->delete(
            sprintf('buckets/%d/chats/%d/integrations/%d.json', $this->bucket, $this->parent, $id)
        );
    }
181619
public function destroy($id)
    {
        $model = $this->getModelName();

        $nodeType = $model::findOrFail($id);

        $this->builderService->destroyTable(
            $nodeType->getName(),
            $nodeType->getFieldKeys(),
            $nodeType->getKey()
        );

        $nodeType->delete();

        return $nodeType;
    }
456301
public function destroy(Request $request, $id)
    {
        $node = Menu::where('id', $id)->first();
        $node->delete();

        return $this->response()->noContent();
    }
1285191
public function getDelete($id = null)
    {
        // Get comment information
        $comment = Comments::getCommentsRepository()->find($id);

        if ($comment == null)
        {
            // Prepare the error message
            $error = Lang::get('comments.comment.not_found');

            // Redirect to the post management page
            return Redirect::route('posts')->with('error', $error);
        }

        Base::Log('Comment (' . $comment->id . ') was deleted.');

        // Delete the post
        $comment->delete();

        // Prepare the success message
        $success = Lang::get('comments.comment.deleted');

        // Redirect to the post management page
        return Redirect::back()->with('success', $success);
    }
122612
public function deleteComment()
    {
        $userIsAllowed = $this
            ->userCredentialsProvider
            ->isAllowed();
        if (!$userIsAllowed) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'The user is not allowed to delete a comment',
            ], 401);
        }

        $sourceUUID = $this->getSourceUUID();
        if (empty($sourceUUID)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Source UUID header must be defined',
            ], 400);
        }
        
        $authorUUID = $this
            ->userCredentialsProvider
            ->getUUID();
        if (empty($authorUUID)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Author UUID must be defined',
            ], 400);
        }

        $postParameterBag = $this
            ->request
            ->request;
        $commentId = $postParameterBag->get('comment_id');

        if (empty($commentId)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Some query parameters are missing',
            ], 400);
        }

        $commentReference = new CommentUUID($commentId);
        $comment = $this
            ->commentRepository
            ->findComment($commentReference)
            ->getFirstComment();

        if (!$comment instanceof Comment) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Comment not found',
            ], 404);
        }

        if (!$this->userCredentialsProvider->isModerator()) {
            if ($comment->getAuthorUUID() !== $authorUUID) {
                return new JsonResponse([
                    'status' => 'Error',
                    'message' => 'You are not authorized to delete this comment',
                ], 401);
            }
        }

        $this
            ->commentRepository
            ->deleteComment($comment);
        $this->flushRepository();

        return new JsonResponse([
            'status' => 'OK',
            'comment' => 'Comment deleted',
        ], 200);
    }
1018047
public function update(CommentsServiceContract $commentsService, SaveCommentRequestContract $request, int $id = 0): SaveResponseContract
    {
        return $this->save($commentsService, $request, $id);
    }
97199
public function deleteComment($commentId)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the success response code.
		$this->oauth->setOption('success_code', 204);

		// Set the API base
		$base = '/v1/comments/' . $commentId;

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'DELETE', $parameters);

		return $response;
	}
957337
public function actionDelete($id)
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        if ($this->findModel($id)->deleteCommunication()) {
            return \Yii::t('net_frenzel_address', 'FRONTEND_WIDGET_COMMENTS_DELETED_COMMENT_TEXT');
        } else {
            Yii::$app->response->setStatusCode(500);
            return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_DELETE');
        }
    }
1151761
public function sendComment(CommentsServiceContract $commentsService,
                                Request $request,
                                string $type,
                                string $id): SendCommentResponseContract
    {
        $rules = [
            'message' => 'required',
        ];

        if (! auth()->user()) {
            $rules = array_merge($rules, [
                'name' => 'required|max:255',
                'email' => 'required|max:255|email',
                'g-recaptcha-response' => [
                    'required',
                    new CaptchaRule,
                ],
            ]);
        }

        Validator::make($request->all(), $rules, [
            'message.required' => 'Поле «Сообщение» обязательно для заполнения',
            'name.required' => 'Поле «Имя» обязательно для заполнения',
            'name.max' => 'Поле «Имя» не должно превышать 255 символов',
            'email.required' => 'Поле «Email» обязательно для заполнения',
            'email.max' => 'Поле «Email» не должно превышать 255 символов',
            'email.email' => 'Поле «Email» должно содержать значение в корректном формате',
            'g-recaptcha-response.required' => 'Поле «Капча» обязательно для заполнения',
            'g-recaptcha-response.captcha'  => 'Неверный код капча',
        ])->validate();

        $data = $request->only($commentsService->getModel()->getFillable());

        $item = $commentsService->saveComment($data, $type, $id);

        $result = ($item && isset($item->id));

        return app()->makeWith(SendCommentResponseContract::class, compact('result'));
    }
392491
public function deleteCommentAction($commentId, $authorToken)
    {
        $comment = $this->findComment(
            $commentId,
            $authorToken
        );

        $this
            ->commentManager
            ->removeComment(
                $comment
            );

        return new Response();
    }
723454
public function actionDelete($id)
    {
        $commentModel = $this->findModel($id);
        $commentModel->setScenario(CommentModel::SCENARIO_MODERATION);
        $event = Yii::createObject(['class' => CommentEvent::class, 'commentModel' => $commentModel]);
        $this->trigger(self::EVENT_BEFORE_DELETE, $event);

        if ($commentModel->markRejected()) {
            $this->trigger(self::EVENT_AFTER_DELETE, $event);

            return Yii::t('yii2mod.comments', 'Comment has been deleted.');
        } else {
            Yii::$app->response->setStatusCode(500);

            return Yii::t('yii2mod.comments', 'Comment has not been deleted. Please try again!');
        }
    }
624167
function(id, params, headers, callback) {
        var url;
        url = this.client.url() + ("comments/" + (id || ''));
        return this.client.del(url, params, headers, callback);
      }