Deletes pages category
@param string $id Pages category ID
@return \Cake\Network\Response|null
328584
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);

        $category = $this->PagesCategories->get($id);

        //Before deleting, it checks if the category has some pages
        if (!$category->page_count) {
            $this->PagesCategories->deleteOrFail($category);
            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->alert(I18N_BEFORE_DELETE);
        }

        return $this->redirect(['action' => 'index']);
    }
220171
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $model->pageSize = intval($this->module->params['pageSizeAdmin']);
        $page = $model->calcPage();
        $result = $model->delete();
        if ($result) {
            Yii::$app->session->setFlash('success', Yii::t($this->tcModule, 'User #{id} deleted.', ['id' => $id]));
        } else {
            Yii::$app->session->setFlash('error', Yii::t($this->tcModule, 'Deletion user #{id} fail.', ['id' => $id]));
        }
        return $this->redirect(['index', 'id' => $id, 'page' => $page]);
    }
1192511
public function deleteFromFlexiBee($id = null)
    {
        if (is_null($id)) {
            $id = $this->getMyKey();
        }

        $this->performRequest($this->getEvidenceUrl().'/'.self::urlizeId($id),
            'DELETE');
        return $this->lastResponseCode == 200;
    }
421488
public function deletePost( $id ) {

        $userAttributes = $this->service->getUserAttributes();

        $response = $this->service->api( 'wall.delete', 'GET', [
            'owner_id' => $userAttributes['id'],
            'post_id'  => $id
        ] );

        return $response['response'] == 1;
    }
99199
public function delete($id = NULL) {
       return $this->request("DELETE", self::URL_SUBSCRIPTIONS . $id . "/", $api_key = $this->culqi->api_key);
    }
170050
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        if ($model->deleteWithRelated()) {
            set_flash_success_delete_content();
            Seo::deleteAll([
                'obj_type' => $model->name,
            ]);
            TermRelationships::deleteAll([
                'obj_type' => $model->name,
            ]);
        } else {
            set_flash_error_delete_content();
        }

        return $this->goBack(request()->referrer);
    }
1240315
public function delete(string $id)
    {
        $this->request->allowMethod(['post', 'delete']);
        $dashboard = $this->Dashboards->get($id);

        if ($this->Dashboards->delete($dashboard)) {
            /** @var \Search\Model\Table\WidgetsTable */
            $widgetTable = TableRegistry::get('Search.Widgets');
            $widgetTable->trashAll([
                'dashboard_id' => $id
            ]);

            $this->Flash->success((string)__('The dashboard has been deleted.'));
        } else {
            $this->Flash->error((string)__('The dashboard could not be deleted. Please, try again.'));
        }

        return $this->redirect(['action' => 'index']);
    }
970983
public function deleteDestroy($id) {
    // Delete children if any exist
    Term::whereParent($id)->delete();

    // Delete Term
    Term::destroy($id);

    return Response::make('OK', 200);
  }
1060175
public function deleteAction($id)
    {
        $response = $this->getResponse();
        $this->model->deleteRecord($id);
        $response->setStatusCode(Response::HTTP_NO_CONTENT);

        return $response;
    }
938261
public function deleteAction($id)
    {
        $reviewManager = $this->get('opifer.review.review_manager');
        $review = $reviewManager->getRepository()->find($id);

        $em = $this->getDoctrine()->getManager();
        $em->remove($review);
        $em->flush();

        return $this->redirectToRoute('opifer_review_review_index');
    }
1306050
public function deletePost( $id ) {
        $response = $this->service->api( 'statuses/destroy/' . $id . '.json', 'POST' );

        return isset( $response['id'] ) && $response['id'] == $id;
    }
558814
public function delete($id = null)
    {
        if (!is_null($id)) {
            $this->setId($id);
        }

        return $this->getDbGateway()->delete($this->getId());
    }
8343
public function delete($id)
    {
        if ($id instanceof DocumentInterface) {
            $id = $id->getId();
        }

        $path = $this->getPathForDocument($id);

        return unlink($path);
    }
704344
protected function deleteRelatedContent($id = NULL) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $content = $this->CmsContent->get($id);
        if (trim($content->content_path) != '')
            $this->_removeFile($content->content_path);
        return $this->CmsContent->delete($content);
    }
700306
public function deletePage($page_id)
    {
        try {
            return json_decode($this->getClient()->delete('content/' . $page_id)->getBody(), true);
        } catch (BadResponseException $e) {
            throw $this->handleError($e);
        }
    }
640185
public function handleDelete(int $id = null)
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=4");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=4";
            }
        }
        $navigation = $this->core->api('Navigation/' . $id, 'DELETE')->run();
        if ($navigation['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=4");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=4";
            }
        } elseif (($navigation["headers"][0][2] - 200) * ($navigation["headers"][0][2] - 299) > 0) {
            return $this->templates->render("500", [
                "error" => $navigation['response'],
                "result" => ''
            ]);
        }

        if (isset($_GET['template']) === false) {
            return redirect($this->router->generate('navigations-page') . "?m=3");
        } else {
            return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=3";
        }
    }
950427
public function deleteAction($id)
    {
        $this->view->disable();
        $banner = Banner::findFirstByid($id);
        if (!$banner) {
            $alert  = "error";
            $msg    = "banner not Found";
        }
        if (! empty($banner->file)) {
            if(file_exists($this->path.$banner->file)){
                unlink($this->path.$banner->file);
            }
        }
        if (!$banner->delete()) {
            $alert  = "error";
            $msg    = " ";
            foreach ($banner->getMessages() as $message) {
                $msg .= $message." ";
            }
        }else{
            $alert  = "sukses";
            $msg    = "banner was deleted ";
        }

        $response = new \Phalcon\Http\Response();
        $response->setContentType('application/json', 'UTF-8');
        $response->setJsonContent(array('_id' => $id,'alert' => $alert, 'msg' => $msg ));
        return $response->send();
    }