deleteAction override from CRUDController.

@param int|null $id Object id

@see Sonata\AdminBundle\Controller\CRUDController::delete()

@return Response|RedirectResponse
164053
public function deleteAction($id)
    {
        try {
            return parent::deleteAction($id);
        } catch (\Exception $e) {
            return $this->deleteActionException($e);
        }
    }
1140786
public function delete($id = null)
    {
        if (! is_null($id)) $this->where('id', '=', $id);

        $sql = $this->grammar->compileDelete($this);

        return $this->connection->delete($sql, $this->getBindings());
    }
388590
public function delete($id = null) {
		$block = $this->Blocks->get($id);
		$this->request->allowMethod('post', 'delete');
		if ($this->Blocks->delete($block)) {
			$this->Flash->success('The block has been deleted.');
		} else {
			$this->Flash->error('The block could not be deleted. Please, try again.');
		}
		return $this->redirect(['action' => 'index']);
	}
999361
public function delete($id)
    {
        $this->request->allowMethod('post');

        $menu = $this->Menus->get($id);
        if ($this->Menus->delete($menu)) {
            $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been deleted.', $menu->name));
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }
        $this->redirect(['action' => 'index']);
        return;
    }
226340
public function delete($id)
    {
        try {
            $this->roleRepositoryInterface->delete($id);
        } catch (RolesException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('roles.index');
        }

        Flash::success(trans('dashboard::dashboard.flash.role.delete.success'));

        return redirect()->route('roles.index');
    }
1219926
public function deleteAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $cron = $em->getRepository('OpiferCmsBundle:Cron')->find($id);

        $em->remove($cron);
        $em->flush();

        return $this->redirectToRoute('opifer_cms_cronjob_index');
    }
660279
public function delete(?string $id = null): ?Response
    {
        $this->request->allowMethod(['post', 'delete']);
        $calendarAttendee = $this->CalendarAttendees->get($id);
        if ($this->CalendarAttendees->delete($calendarAttendee)) {
            $this->Flash->success((string)__('The calendar attendee has been deleted.'));
        } else {
            $this->Flash->error((string)__('The calendar attendee could not be deleted. Please, try again.'));
        }

        return $this->redirect(['plugin' => 'Qobo/Calendar', 'controller' => 'Calendars', 'action' => 'index']);
    }
55564
public function delete($id = null)
    {
        if (! $id) {
            $id = $this->data->id;
        }

        return $this->client->delete('/{id}', ['id' => $id]);
    }
509531
public function delete($id = null)
	{
		$wheres = $this->compileWheres();

		foreach ($this->get() as $entity)
		{
			$this->collection->remove($entity);
		}
	}
592266
public function delete($id = null)
    {
        // If an ID is passed to the method, we will set the where clause to check the
        // ID to let developers to simply and quickly remove a single row from this
        // database without manually specifying the "where" clauses on the query.
        if (! is_null($id)) {
            $this->where($this->from.'.id', '=', $id);
        }

        return $this->connection->delete(
            $this->grammar->compileDelete($this), $this->cleanBindings(
                $this->grammar->prepareBindingsForDelete($this->bindings)
            )
        );
    }
115885
public function delete(string $id)
    {
        $this->request->allowMethod(['post', 'delete']);
        $dblist = $this->Dblists->get($id);
        if ($this->Dblists->delete($dblist)) {
            $this->Flash->success('The database list has been deleted.');
        } else {
            $this->Flash->error('The database list could not be deleted. Please, try again.');
        }

        return $this->redirect(['action' => 'index']);
    }
84838
public function delete(string $id = null)
    {
        $this->request->allowMethod(['post', 'delete']);
        $data = $this->request->getData();
        $permission = $this->Permissions->get($id);
        if ($this->Permissions->delete($permission)) {
            $this->Flash->success((string)__('The  permission has been deleted.'));
        } else {
            $this->Flash->error((string)__('The  permission could not be deleted. Please, try again.'));
        }

        $this->redirect($this->referer());
    }
806405
public function actionDelete($id)
    {
        if (Yii::$app->request->isPost) {
            $this->findModel($id)->delete();
        }
        return $this->redirect(['index']);
    }
825492
public function delete($id = null) {
        $this->request->allowMethod(['post', 'delete']);
        $cmsTermTaxonomy = $this->CmsTermTaxonomy->get($id);
        if ($this->CmsTermTaxonomy->delete($cmsTermTaxonomy)) {
            $this->Flash->success('The cms term taxonomy has been deleted.');
        } else {
            $this->Flash->error('The cms term taxonomy could not be deleted. Please, try again.');
        }
        return $this->redirect(['action' => 'index']);
    }
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']);
    }
632452
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);

        $group = $this->UsersGroups->get($id);

        //Before deleting, checks if the group is a necessary group or if the group has some users
        if ($id > 3 && !$group->user_count) {
            $this->UsersGroups->deleteOrFail($group);

            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->alert($id <= 3 ? __d('me_cms', 'You cannot delete this users group') : I18N_BEFORE_DELETE);
        }

        return $this->redirect(['action' => 'index']);
    }
827603
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $model->delete();

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