Creates a form to delete a Category entity by id.

@param mixed $id The entity id

@return Form The form
486551
private function createDeleteForm($id) {
        return $this->createFormBuilder()
                        ->setAction($this->generateUrl('admin_news_category_delete', array('id' => $id)))
                        ->setMethod('DELETE')
                        ->add('submit', 'submit', array('label' => 'Delete',
                            'attr' => array(
                                    'onclick' => 'return confirm("Estás seguro?")'
                            )))
                        ->getForm()
        ;
    }
118927
public function deleteAction($id)
    {
        $documentManager = $this->getDocumentManager();
        $document = $documentManager->find($id);
        $documentManager->remove($document);
        $documentManager->flush();

        return $this->handleView($this->view(null));
    }
654604
public function delete($id)
    {
        $db = new DatabaseManager();
        $connection = $db->getDbh();

        $sql = 'DELETE from :table WHERE id=:id';
        $sql = str_replace(':table', $this->tableName, $sql);

        $statement = $connection->prepare($sql);
//        $statement->bindParam(':table',  $this->tableName);
        $statement->bindParam(':id', $id, \PDO::PARAM_INT);

        $queryWasSuccessful = $statement->execute();
        return $queryWasSuccessful;
    }
670176
private function createEditForm(Category $entity)
    {
        $form = $this->createForm($this->get("amulen.classification.form.category"), $entity, array(
            'action' => $this->generateUrl('admin_category_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
830952
public function deleteAction($id)
    {
        $targetGroup = $this->retrieveTargetGroupById($id);

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

        return $this->handleView($this->view(null, 204));
    }
1230929
public function deleteAction($id)
    {
        $delete = function ($id) {
            $this->getManager()->delete($id);
        };
        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
1304160
public static function delete($id)
    {
        $db = new DatabaseManager();
        $connection = $db->getDbh();

        $statement = $connection->prepare('DELETE from ' . static::getTableName()  . ' WHERE id=:id');
        $statement->bindParam(':id', $id, \PDO::PARAM_INT);
        $queryWasSuccessful = $statement->execute();
        return $queryWasSuccessful;
    }
348936
public function deleteAction($id)
    {
        $delete = function($id) {
            try {
                $this->getManager()->delete($id);
            } catch (TagNotFoundException $tnfe) {
                throw new EntityNotFoundException(self::$entityName, $id);
            }
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
908421
public function delete(string $id)
    {
        $this->request->allowMethod(['post', 'delete']);
        $model = $this->loadModel();
        $entity = $model->get($id);

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

        $url = $this->referer();

        if (false !== strpos($url, $id)) {
            $url = ['action' => 'index'];
        }

        return $this->redirect($url);
    }
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);
    }
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']);
    }
1122199
private function createEntityID(string $id): EntityID
    {
        return new EntityID($this->entityManager, $this->className, $id);
    }
1108340
public function delete($id)
    {
        $delete = "DELETE FROM " . $this->getTable() . " " .
            "WHERE " . $this->getPrimaryKey() . " = '" . intval($id) . "' LIMIT 1 ;";

        return $this->db->query($delete);
    }
612473
public function actionDelete($id)
    {
        $model = $this->findModel($id);

        $model->orderBy = $model::$defaultOrderBy;
        $model->page = $model->calcPage($model::find()->where(['parent_id' => $model->parent_id]));
        $returnTo = ['index', // try to return to same place - deletion may be unsuccessfull
            'parent_id' => $model->parent_id,
            'page'      => $model->page,
            'id'        => $id,
            'sort'      => $model->orderByToSort(),
        ];

        $model->delete();

        return $this->redirect($returnTo);
    }
1261444
public function delete_post( $id ) {

		$post = get_post( $id );

		if ( empty( $post ) ) {
			return;
		}

		$id        = $post->ID;
		$post_type = $post->post_type;

		return $this->delete_object( 'post_type', $id, $post_type );
	}
806564
public function delete($id)
    {
        if ($this->hasDeleteTrait($this->modelInstance)) {
            return $this->destroy($id);
        }

        return $this->modelInstance->destroy($id);
    }
235445
public static function Delete(int $id, $drop_children = false)
    {
        return self::$Categories->delete($id, $drop_children);
    }