Deletes an existing Faq model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
334170
public function actionStatus($id)
    {
        $model = $this->findModel($id);
        if($model->status == "active") {
            $model->status = "inactive";
        } else {
            $model->status = "active";
        }
        $model->save(false);
        if(Yii::$app->request->getIsAjax()) {
            Yii::$app->response->format = 'json';
            return ['success' => true];
        } else {
            return $this->redirect(['index']);
        }
    }
1364712
public function deleteAction($id)
    {
        $instance = $this->getManager()->find($id);
        if($instance) {
            $this->getManager()->delete($instance);
            $this->get('session')->getFlashBag()->add('success', 'Instance Redis has been deleted successfully');
        }else {
            $this->get('session')->getFlashBag()->add('error', 'This instance does not exist');
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
928301
public function delete($id)
    {
        return $this->model->where($this->model->getKeyName(), $id)->delete();
    }
1030052
public function actionRemove(int $id)
    {

        RelatedProduct::deleteAll(['id' => $id]);

        return $this->redirect(\Yii::$app->request->referrer);
    }
1176423
public function delete($id) {
        $this->checkPermissions('delete');
        
        return $this->client->deleteData($this->resourceName . '/' . $id);
    }
549487
public function delete(string $id)
    {
        $this->request->allowMethod(['post', 'delete']);
        $group = $this->Groups->get($id);
        if ($this->Groups->delete($group)) {
            $this->Flash->success((string)__('The group has been deleted.'));
        } else {
            $this->Flash->error((string)__('The group could not be deleted. Please, try again.'));
        }

        return $this->redirect(['action' => 'index']);
    }
943581
public function delete(string $id)
    {
        $url = $this->url.'/'.$id;

        return $this->curl->delete($url);
    }
404391
public function deleteAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $em->remove($this->getImage($id));
        $em->flush();

        return new Response();
    }
799211
public function actionDelete(string $id)
    {
        $model = $this->findModel($id);
        Yii::$app->authManager->remove($model->item);
        Yii::$app->session->setFlash('success', Yii::t('yii2mod.rbac', 'Rule has been deleted.'));

        return $this->redirect(['index']);
    }
1175433
public function delete($id = null) {
        $role = $this->Roles->get($id);
        if ($this->request->is(['patch', 'post', 'put'])) {
            if ($this->Roles->delete($role)) {
                $this->Flash->success(__('The role has been deleted.'));
            } else {
                $this->Flash->error(__('The role could not be deleted. Please, try again.'));
            }
            return $this->redirect(['action' => 'index']);
        }
        $this->set(compact('role'));
    }
100445
public function deleteAction($id)
    {
        $manager = $this->getTaskManager();
        $manager->remove($id);

        $this->getEntityManager()->flush();

        return $this->handleView($this->view());
    }
947800
public function destroy($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        if ( ! $this->isModelDeletable($record)) {
            return $this->failureResponse(
                $this->getLastUnmetDeleteConditionMessage()
            );
        }

        event( new Events\DeletingModelInCms($record) );

        if ( ! $this->deleteModel($record)) {
            // @codeCoverageIgnoreStart
            return $this->failureResponse(
                cms_trans('models.delete.failure.unknown')
            );
            // @codeCoverageIgnoreEnd
        }

        event( new Events\ModelDeletedInCms($this->getModelInformation()->modelClass(), $id) );

        if (request()->ajax()) {
            return response()->json([
                'success' => true,
            ]);
        }

        cms_flash(
            cms_trans(
                'models.delete.success-message',
                [ 'record' => $this->getSimpleRecordReference($id, $record) ]
            ),
            FlashLevel::SUCCESS
        );

        return redirect()->back();
    }
1192646
public function destroy($id)
    {
        $faq = $this->repository->find($id);

        if (empty($faq)) {
            Cms::notification('FAQ not found', 'warning');

            return redirect(route($this->routeBase.'.faqs.index'));
        }

        $faq->delete();

        Cms::notification('FAQ deleted successfully.', 'success');

        return redirect(route($this->routeBase.'.faqs.index'));
    }
1253728
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);
        $cmsTerm = $this->CmsTerm->get($id);
        if ($this->CmsTerm->delete($cmsTerm)) {
            $this->Flash->success('The cms term has been deleted.');
        } else {
            $this->Flash->error('The cms term could not be deleted. Please, try again.');
        }
        return $this->redirect(['action' => 'index']);
    }
311750
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        Yii::$app->getUserAuthManager()->remove($model->item);
        UserRBACHelper::invalidate();
        return $this->redirect(['index']);
    }
282394
public function delete($id)
	{
		Yii::trace('Deleting "'.$id.'" from cache','system.caching.'.get_class($this));
		return $this->deleteValue($this->generateUniqueKey($id));
	}
1023142
public function actionDelete($id)
    {
        $this->findModel($id)->updateAttributes(['status' => User::STATUS_DELETED]);

        return $this->redirect(['index']);
    }