delete method

@throws NotFoundException
@param string $id
@return void
549220
public function delete($id = null) {
		$this->UnidadDeMedida->id = $id;
		if (!$this->UnidadDeMedida->exists()) {
			throw new NotFoundException(__('Unidad De Medida Inválido'));
		}
		$this->request->allowMethod('post', 'delete');
		if ($this->UnidadDeMedida->delete()) {
			$this->Flash->success(__('Se ha borrado la Unidad de Medida.'));
		} else {
			$this->Flash->error(__('No se ha podido eliminar la Unidad de Medida'), 'Risto.flash_error');
		}
		return $this->redirect($this->referer());
	}
1163428
public function delete($id)
    {
        $this->_deletedDirty = true;

        if (extension_loaded('bitset')) {
            if ($this->_deleted === null) {
                $this->_deleted = bitset_empty($id);
            }
            bitset_incl($this->_deleted, $id);
        } else {
            if ($this->_deleted === null) {
                $this->_deleted = array();
            }

            $this->_deleted[$id] = 1;
        }
    }
969360
public function delete($id = null)
	{
		if ($id === null) {
			foreach ($this->getLogs() as $log) {
				unlink($this->path . $log->name);
			}
		} elseif (is_array($id)) {
			foreach ($id as $key) {
				unlink($this->path . $this->getLog($key)->name);
			}
		} else {
			unlink($this->path . $this->getLog((string) $id)->name);
		}
		$this->logs = null;
	}
357571
public function deleteID($ID)
    {
        if($this->offsetExists($this->safeOffset($ID))) {
            $this->offsetUnset($this->safeOffset($ID));
        } else {
            throw new CollectionIDNotFoundException('ID "' . $ID . '" does not exist in collection');
        }
    }
661901
public function delete($id)
	{
		try {
			$this->getIndex()->deleteObject($id);
		} catch (\Exception $e) {
			return false;
		}
		
		return true;
	}
1165740
public function delete($id)
    {
        $model = $this->model->where('id', $id)->first();
        if (!$model) {
            return false;
        }
        return $model->delete();
    }
1126360
public function deleteDoc($id)
    {
        $this->config['client']->delete(
            [
                'id' => $id,
                'index' => $this->getIndex()->getName(),
                'type' => $this->getType()
            ]
        );
    }
776325
public function deleteReserved($id)
    {
        $this->db->transaction(function () use ($id) {
            if ($this->db->name($this->table)->lock(true)->find($id)) {
                $this->db->name($this->table)->where('id', $id)->delete();
            }
        });
    }
95297
public function delete($id = null) {
		$this->AfipFactura->id = $id;
		if (!$this->AfipFactura->exists()) {
			throw new NotFoundException(__('Invalid afip factura'));
		}
		$this->request->allowMethod('post', 'delete');
		if ($this->AfipFactura->delete()) {
			$this->Session->setFlash(__('The afip factura has been deleted.'));
		} else {
			$this->Session->setFlash(__('The afip factura could not be deleted. Please, try again.'));
		}
		return $this->redirect(array('action' => 'index'));
	}
239775
public function delete(string $id): bool
    {
        if (\array_key_exists($id, $this->cache)) {

            //delete value
            unset($this->cache[$id]);

            //return function result
            return true;
        }

        return false;
    }
387210
public function delete($id)
    {
        if ($record = $this->find($id)) {
            if ($this->preDelete($id, $record)) {
                return $this->postDelete($id, $record->delete(), $record);
            }
        } else {
            $this->throwModelNotFoundException($id);
        }
    }
1098217
public function delete($id)
    {
        if (!$this->request->is('post')) {
            throw new MethodNotAllowedException();
        }

        /** @var User $user */
        $user = $this->Users->get($id);
        if ($this->Users->delete($user)) {
            $this->Flash->success(__d('wasabi_core', 'The user <strong>{0}</strong> has been deleted.', $user->username));
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }

        $this->redirect($this->Filter->getBacklink(['action' => 'index'], $this->request));
        //@codingStandardIgnoreStart
        return;
        //@codingStandardIgnoreEnd
    }
1137825
public void deleteById(Object id) {

        int count = beginDelete().whereEquals(idColumn.getColumnName(), id).delete();

        if (count == 0) {
            throw new RowNotFoundException(table, id);
        }
    }
1338678
public function delete($id)
    {
        $this->loadModel('User.Roles');
        $role = $this->Roles->get($id);

        if (!in_array($role->id, [ROLE_ID_ADMINISTRATOR, ROLE_ID_AUTHENTICATED, ROLE_ID_ANONYMOUS])) {
            if ($this->Roles->delete($role)) {
                $this->Flash->success(__d('user', 'Role was successfully removed!'));
            } else {
                $this->Flash->danger(__d('user', 'Role could not be removed'));
            }
        } else {
            $this->Flash->danger(__d('user', 'This role cannot be deleted!'));
        }

        $this->title(__d('user', 'Remove User Role'));
        $this->redirect($this->referer());
    }
610495
public function deleteAction($id)
    {
        $delete = function($id) {
            $role = $this->getRoleRepository()->findRoleById($id);

            if (!$role) {
                throw new EntityNotFoundException($this->getRoleRepository()->getClassName(), $id);
            }

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

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

        return $this->handleView($view);
    }
325700
public function delete($id)
    {
        $query = $this->createQueryBuilder();

        $query->where($this->getPrimaryKey($query), $id);
        $query->delete();
    }
921064
public function deleteAction($id)
    {
        $delete = function($id) {
            $group = $this->getDoctrine()
                ->getRepository(static::$entityName)
                ->findGroupById($id);

            if (!$group) {
                throw new EntityNotFoundException(static::$entityName, $id);
            }

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

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

        return $this->handleView($view);
    }