Deletes selected in post.
If deletion is successful, the browser will be redirected to the 'index' page.
@return mixed
502814
public function actionDeleteIn()
    {
        $selected = Yii::$app->request->post('selected' , []);

        $ret = \yongtiger\admin\models\Log::deleteAll(['id' => explode(',', $selected)]);
        $str = $ret > 0 ? ' (IDs [' . $selected . '])' : '';
        Yii::$app->session->setFlash('info', Module::t('message', 'Deleted {0} logs.', $ret) . $str);

        return $this->redirect(['index']);
    }
136019
public function delete()
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Get items to remove from the request.
		$cid = $this->input->get('cid', array(), 'array');
		$extension = $this->input->getCmd('extension', null);

		if (!is_array($cid) || count($cid) < 1)
		{
			JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
		}
		else
		{
			// Get the model.
			/** @var CategoriesModelCategory $model */
			$model = $this->getModel();

			// Make sure the item ids are integers
			$cid = ArrayHelper::toInteger($cid);

			// Remove the items.
			if ($model->delete($cid))
			{
				$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
			}
			else
			{
				$this->setMessage($model->getError());
			}
		}

		$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&extension=' . $extension, false));
	}
754319
public function delete()
    {
        if (isset($this->onDelete)) {
            return call_user_func($this->onDelete, $this);
        }

        return $this->query->delete();
    }
137346
public function delete()
    {
        $data = $this->getData();
        if (isset($this->currentId))
            unset($data[$this->currentKey]);
        elseif($this->documentEntries)
            $data = array_diff_key($data,$this->documentEntries);
        else
            $data = [];
        $this->documentEntries = array_values($data);
        return $this->databaseDocument->put($this->documentEntries) ? true : false;
    }
522882
protected function handleDELETE()
    {
        /** @var BaseSystemModel $modelClass */
        $modelClass = static::$model;
        $options = $this->request->getParameters();

        if (!empty($this->resource)) {
            return $modelClass::deleteById($this->resource, $options);
        }

        if (!empty($ids = array_get($options, ApiOptions::IDS))) {
            $result = $modelClass::deleteByIds($ids, $options);
        } else {
            $records = ResourcesWrapper::unwrapResources($this->getPayloadData());
            if (!empty($records)) {
                $result = $modelClass::bulkDelete($records, $options);
            } else {
                $filter = array_get($options, ApiOptions::FILTER);
                if (!empty($filter)) {
                    $params = array_get($options, ApiOptions::PARAMS, []);
                    $result = $modelClass::deleteByFilter($filter, $params, $options);
                } else {
                    if (!array_get_bool($options, ApiOptions::FORCE)) {
                        throw new BadRequestException('No filter or records given for delete request.');
                    }

                    return $modelClass::truncate($options);
                }
            }
        }

        $asList = $this->request->getParameterAsBool(ApiOptions::AS_LIST);
        $idField = $this->request->getParameter(ApiOptions::ID_FIELD, static::getResourceIdentifier());
        $result = ResourcesWrapper::cleanResources($result, $asList, $idField, ApiOptions::FIELDS_ALL);

        return $result;
    }
1022227
public function deleteAction()
    {
        $leaderboardId = $this->getEvent()->getRouteMatch()->getParam('leaderboardId');
        $leaderboard = $this->getLeaderboardTypeService()->findById($leaderboardId);
        $name = $leaderboard->getName();
        $this->getLeaderboardTypeService()->remove($leaderboard);
        $this->flashMessenger()->addMessage('The leaderboard "'.$name.'"has been deleted');

        return $this->redirect()->toRoute('admin/leaderboardtype/list');
    }
340139
function delete() {

        // if this is an association result or it is limited,
        // create specific result for local rows and execute

        if ( $this->parent_ || isset( $this->limitCount ) ) {

            return $this->primaryResult()->delete();

        }

        return $this->db->delete( $this->table, $this->where, $this->whereParams );

    }
272385
public function delete()
    {
        $this->exitIfModelNotSet();

        $params = [
            'id'    => $this->model->getKey(),
            'type'  => $this->model->getDocumentType(),
            'index' => $this->model->getDocumentIndex(),
        ];

        // check if the document exists before deleting
        if ($this->connection->existsStatement($params)) {
            return $this->connection->deleteStatement($params);
        }

        return true;
    }
1176941
public function delete()
    {
        $url = $this->url;
        if (!empty($this->replaceParams)) {
            $url = self::buildUri($url, $this->replaceParams);
        }
        $this->adapter->setResponseTimeout($this->getResponseTimeout());
        $this->adapter->setConnectTimeout($this->getConnectTimeout());

        return $this->adapter->delete(
            $url,
            array(
                self::HEADERS => $this->headers,
            )
        );
    }
251436
public function actionDelete()
	{
		if(Yii::app()->request->isPostRequest)
		{
			// we only allow deletion via POST request
			$this->loadModel()->delete();

			// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
			if(!isset($_POST['ajax']))
				$this->redirect(array('index'));
		}
		else
			throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
	}
587462
public function onRelationManageDelete()
    {
        $this->beforeAjax();

        /*
         * Multiple (has many, belongs to many)
         */
        if ($this->viewMode == 'multi') {
            if (($checkedIds = post('checked')) && is_array($checkedIds)) {
                 foreach ($checkedIds as $relationId) {
                    if (!$obj = $this->relationModel->find($relationId)) {
                        continue;
                    }

                    $obj->delete();
                }
            }
        }
        /*
         * Single (belongs to, has one)
         */
        elseif ($this->viewMode == 'single') {
            $relatedModel = $this->viewModel;
            if ($relatedModel->exists) {
                $relatedModel->delete();
            }

            $this->viewWidget->setFormValues([]);
            $this->viewModel = $this->relationModel;
        }

        return $this->relationRefresh();
    }
1076487
public function deleteAll()
    {
        $this->request->allowMethod(['post', 'delete']);
        $this->BackupManager->deleteAll();
        $this->Flash->success(I18N_OPERATION_OK);

        return $this->redirect(['action' => 'index']);
    }
569072
public function delete()
    {
        if ($this->getPk() === null) {
            return false;
        }
        $query = $this->_queryClass;
        $bindKey = PdoBindHelper::generateBindKey();
        $result = DbConnector::getAdapter()->delete((new $query)->getTableName(), $this->_pkWhere($bindKey), [$bindKey => $this->getInitialStateValue('id')]);
        return ($result > 0) ? true : false;
    }
1287402
public function delete()
    {
        $db = $this->getConnection();
        return $db->delete(
            $this->getDatabase() . urlencode( $this->_id ) . '?rev=' . $this->_rev
        ); 
    }
476392
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);

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

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

        return $this->redirect(['action' => 'index']);
    }
1202858
protected function delete()
    {
        $nodeRef = $this->buildCmsNodeRef('Slug');

        $node = $nodeRef->generateNode();

        $location = 'load';
        $this->Events->trigger('NodeCmsController.delete'.'.'.$location,
                                    $this->errors, $this->templateVars, $node);
        foreach((array)$nodeRef->getElement()->getAspects() as $aspect)
            $this->Events->trigger('NodeCmsController.@'.$aspect->Slug.'.'.'delete'.'.'.$location,
                                    $this->errors, $this->templateVars, $node);

        if (!$node->hasTitle())
            //get default form backing object
            $node = $this->RegulatedNodeService->getByNodeRef($node->getNodeRef());

        if (empty($node))
            throw new NotFoundException('Record not found for NodeRef: '.$nodeRef);

        // check permissions
        // $this->checkDeletePermission($node);

        if (!$this->buttonPushed()) {
            $this->Session->setFlashAttribute('delete_referer', $this->Request->getReferrer());
            //show delete confirmation view (action_form_view)
            return new View($this->formView());
        }

        if ($this->saveButtonPushed()) {
            $this->checkNonce();
            $mergeSlug = null;
            $tags      = isset($this->params['OutTags']['#merge'])  ?
                           $this->params['OutTags']['#merge']
                         : array();

            if (!empty($tags)) {
                $newtag = new Tag(current($tags));

                if ($newtag->TagElement != $nodeRef->getElement()->getSlug())
                    throw new Exception('Unable to merge with different element ['.$newtag->TagElement.']');

                $mergeSlug = $newtag->TagSlug;
            }

            $location = 'pre';
            $this->Events->trigger('NodeCmsController.delete'.'.'.$location,
                                    $this->errors, $this->templateVars, $node, $mergeSlug);
            foreach ((array)$nodeRef->getElement()->getAspects() as $aspect)
                $this->Events->trigger('NodeCmsController.@'.$aspect->Slug.'.'.'delete'.'.'.$location,
                                        $this->errors, $this->templateVars, $node, $mergeSlug);

            $this->getErrors()->throwOnError();


            $this->RegulatedNodeService->delete($nodeRef, $mergeSlug);

            $location = 'post';
            $this->Events->trigger('NodeCmsController.delete'.'.'.$location, $this->errors, $this->templateVars, $node);
            foreach ((array)$nodeRef->getElement()->getAspects() as $aspect)
                $this->Events->trigger('NodeCmsController.@'.$aspect->Slug.'.'.'delete'.'.'.$location, $this->errors, $this->templateVars, $node);

            //redirect to news list (action_success_view)
            return new View($this->successView());
        }

        if ($this->cancelButtonPushed())
            //redirect to referer
            return new View('redirect:'.$this->Session->getFlashAttribute('delete_referer'));  //$this->cancelView());

        throw new Exception("unsupported button for this action");
    }
1104836
public function delete()
    {
        $args = func_get_args();

        return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_DELETE);
    }