Receive Model Entry Delete Post Data, validate it and return user.

@param int $modelitemId

@return \Illuminate\Http\RedirectResponse
194450
public function postDelete($modelitemId)
    {
        if (!$this->modelAdmin->hasDeleting()) {
            return $this->missingMethod();
        }

        $this->modelAdmin->delete($modelitemId);

        return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->getTitle().' was successfully removed.', 'dismissable' => false]]);
    }
580331
public function clone($modelitemId)
    {
        event(new BeforeClone($this));

        $this->beforeClone();

        $this->doClone();

        $this->afterClone();

        event(new AfterClone($this));
    }
611440
public function get($redirectId, array $params = array())
    {
        $endpoint = '/admin/redirects/'.$redirectId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Redirect::class, $response['redirect']);
    }
252111
public function setModelId($modelId)
    {
        $this->modelId = (string)$modelId;
        $this->model   = null;
        return $this;
    }
492648
public function deleteSenderAsyncWithHttpInfo($senderId)
    {
        $returnType = '';
        $request = $this->deleteSenderRequest($senderId);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
640375
public function actionUpdateItemTypeData($navItemId)
    {
        return NavItem::findOne($navItemId)->updateType(Yii::$app->request->post());
    }
1326882
public function actionDelete($navItemId)
    {
        if (!Yii::$app->adminuser->canRoute(Module::ROUTE_PAGE_DELETE)) {
            throw new ForbiddenHttpException("Unable to perform this action due to permission restrictions");
        }
        
        $model = NavItem::findOne($navItemId);
        
        if ($model) {
            return $model->delete();
        }
        
        return $this->sendModelError($model);
    }
32143
public function deleteDriveItem($driveItemId)
    {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::delete()'
                . ' instead',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive = $this->getMyDrive();
        $item  = $this->getDriveItemById($drive->id, $driveItemId);
        $item->delete();
    }
448920
protected function _actionCancel(ControllerContextModel $context)
    {
        //Create the redirect
        $context->response->setRedirect($this->getReferrer($context));

        if ($context->result instanceof ModelEntityInterface) {
            $entity = $context->result;
        }
        else $entity = $this->getModel()->fetch();

        return $entity;
    }
1281160
public function parse($modelId, $rawConfig, $allowEmpty = false) {
        if (!is_null($rawConfig)) {
            $this->_validate($rawConfig, $allowEmpty);
            return $rawConfig;
        } else throw new Exception("The {$modelId} configuration is NULL.");
    }
514641
public function item($modelName, $itemId = 0)
    {
        $config            = app('itemconfig');
        $fieldFactory      = app('admin_field_factory');
        $actionFactory     = app('admin_action_factory');
        $columnFactory     = app('admin_column_factory');
        $actionPermissions = $actionFactory->getActionPermissions();
        $fields            = $fieldFactory->getEditFields();

        //if it's ajax, we just return the item information as json
        if ($this->request->ajax()) {
            //try to get the object
            $model = $config->getModel($itemId, $fields, $columnFactory->getIncludedColumns($fields));

            if ($model->exists) {
                $model = $config->updateModel($model, $fieldFactory, $actionFactory);
            }

            $response = $actionPermissions['view'] ? response()->json($model) : response()->json(array(
                'success' => false,
                'errors'  => 'You do not have permission to view this item',
            ));

            //set the Vary : Accept header to avoid the browser caching the json response
            return $response->header('Vary', 'Accept');
        } else {
            $view = view('administrator::index', array(
                'itemId' => $itemId,
            ));

            //set the layout content and title
            $this->layout->content = $view;

            return $this->layout;
        }
    }
1074556
public static function clear_model_files($modelid) {
        $fs = get_file_storage();
        return $fs->delete_area_files(\context_system::instance()->id, 'analytics', false, $modelid);
    }
34360
public function removeById($modelId)
    {
        foreach ($this->arrCollection as $index => $model) {
            if ($modelId === $model->getId()) {
                unset($this->arrCollection[$index]);
            }
        }
    }
320900
public function callbackRemoveFromIndex($imageId)
    {
        return Yii::$app->db->createCommand()->delete($this->refTableName, [
            $this->imageIdFieldName => (int) $imageId,
            $this->refFieldName => (int) $this->getItemId(),
        ])->execute();
    }
1215373
public function delete($messageId)
    {
        return $this->sendRequest(
            self::METHOD_DELETE,
            str_replace(':message_id', $messageId, self::$endPoints['delete'])
        );
    }
528863
public function getModel($modelId)
    {
        if (!$this->isRegistered($modelId)) {
            throw new PortableModelMissing($modelId);
        }
        return $this->getModelFromConfig($this->get($modelId));
    }
737093
private function renderPasteNewFor($modelId)
    {
        $label = \sprintf($this->translate('pastenew.1'), ModelId::fromSerialized($modelId)->getId());
        return \sprintf(
            '<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a>',
            $this->addToUrl('act=create&amp;after=' . $modelId),
            StringUtil::specialchars($label),
            $this->renderImageAsHtml('new.svg', $label)
        );
    }