Delete multiple models page.

@return mixed
@throws \yii\web\HttpException
492052
public function actionBatchDelete()
    {
        if (($ids = Yii::$app->request->post('ids')) !== null) {
            $models = $this->findModel($ids);
            foreach ($models as $model) {
                $model->delete();
            }
            return $this->redirect(['index']);
        } else {
            throw new HttpException(400);
        }
    }
1240067
public function delete()
    {
        return $this->forge->deleteWorker($this->serverId, $this->siteId, $this->id);
    }
1186126
public function delete()
    {
        if ($this->isNewRecord()) {
            throw new DeleteModelException("New models can't be deleted.");
        }

        $this->beforeDelete();
        $this->raiseEvent("BeforeDelete");

        $this->Deleted = true;
        $this->save();

        $this->afterDelete();
        $this->raiseEvent("AfterDelete");
    }
126556
public function actionDelete($id, $page = 1)
    {
        $model = $this->findModel($id);
/* moved to model:
        $subdir = $this->module->model('News')->getImageSubdir($model->id);
        $fullDir = $this->uploadsNewsDir . '/' . $subdir;//var_dump($fullDir);exit;
        if (is_dir($fullDir)) {
            @FileHelper::removeDirectory($fullDir);
        }
*/
        $model->delete(); // images and i18n-deletions also in main model

        Yii::$app->session->setFlash('success', Yii::t($this->tcModule, 'Record with ID={id} delete success', ['id' => $id]));

        $searchFormName = basename(NewsSearch::className());
        $paramSort = Yii::$app->request->get($searchFormName, []);
        foreach ($paramSort as $key => $val) {
            if (empty($val)) unset($paramSort[$key]);
        }
        return $this->redirect(['index',
            'page' => $page,
            $searchFormName => $paramSort,
            'sort' => $model->orderBy,
        ]);
    }
487998
public function run()
    {
        $model = $this->modelFullName;


        if ($model::deleteAll($this->conditions)) {
            Yii::$app->getSession()->setFlash('success', 'You have deleted all selected records!');
            return $this->controller->goBack();
        }

        Yii::$app->getSession()->setFlash('error', 'You have failed to deleted all selected records!');
		return $this->controller->goBack();
    }
788382
public function run()
    {
        if (isset($this->beforeDeleteCallback)) {
            call_user_func($this->beforeDeleteCallback, $this);
        }

        /* @var $modelClass \yii\db\ActiveRecord */
        $modelClass = $this->modelClass;
        $models = $modelClass::findAll([$this->primaryKey => Yii::$app->request->post('ids')]);
        if (empty($models)) {
            throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'));
        } else {
            foreach ($models as $model) {
                $model->delete();
            }
            if (isset($this->afterDeleteCallback)) {
                call_user_func($this->afterDeleteCallback, $this);
            }

            return $this->redirect();
        }
    }
414463
public function delete()
    {
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();

        $cvID = $this->cvID;
        $c = Page::getByID($this->cID, $cvID);
        $cID = $c->getCollectionID();

        $q = "select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ?";
        $r = $db->executeQuery($q, array(
            $cID,
            $cvID,
        ));
        while ($row = $r->fetch()) {
            if ($row['bID']) {
                $b = Block::getByID($row['bID'], $c, $row['arHandle']);
                if (is_object($b)) {
                    $b->deleteBlock();
                }
                unset($b);
            }
        }

        $features = CollectionVersionFeatureAssignment::getList($this);
        foreach ($features as $fa) {
            $fa->delete();
        }

        $category = $app->make('Concrete\Core\Attribute\Category\PageCategory');
        $attributes = $category->getAttributeValues($this);
        foreach ($attributes as $attribute) {
            $category->deleteValue($attribute);
        }

        $db->executeQuery('delete from CollectionVersionBlockStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionThemeCustomStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionAreaStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));

        $db->executeQuery('delete from PageTypeComposerOutputBlocks where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));

        $q = "delete from CollectionVersions where cID = '{$cID}' and cvID='{$cvID}'";
        $db->executeQuery($q);
        $this->refreshCache();
    }
934115
protected function performDeleteOnModel()
    {
        if ($this->forceDeleting) {
            $this->exists = false;

            return $this->setKeysForSaveQuery($this->newModelQuery())->forceDelete();
        }

        return $this->runSoftDelete();
    }
1256286
public function delete_cached_model(){
    $args = \func_get_args();

    foreach ( $args as $a ){
      if ( \is_string($a) && \strlen($a) ){
        $path = $a;
      }
      else if ( \is_array($a) ){
        $data = $a;
      }
    }
    if ( !isset($path) ){
      $path = $this->path;
    }
    else if ( strpos($path, './') === 0 ){
      $path = $this->say_dir().substr($path, 1);
    }
    if ( !isset($data) ){
      $data = $this->data;
    }
    return $this->mvc->delete_cached_model($path, $data, $this);
  }
825
public function delete( $model, $config = [] ) {

		// Delete files
		$this->fileService->deleteMultiple( [ $model->avatar, $model->banner, $model->video ] );
		$this->fileService->deleteMultiple( $model->files );

		// Delete File Mappings - Shared Files
		$this->modelFileService->deleteMultiple( $model->modelFiles );

		// Delete mapping
		Yii::$app->factory->get( 'modelObjectService' )->deleteByModelId( $model->id );

		// Delete model
		return parent::delete( $model, $config );
	}
790148
public function actionDeleteAll()
    {
        if(isset($_POST['items'])) {
            foreach($_POST['items'] as $id) {
                $this->findModel($id)->deleteWithChildren();
            }
        }
    }
821539
protected function deleteImagesPage()
    {
        $this->controlAccess('page_edit');

        $file_ids = $this->getPosted('delete_images', array(), true, 'array');
        return $this->image->delete($file_ids);
    }
1222087
public function delete()
    {
        $column  = Input::get('params.column');
        $session = app('request')->session();
        $key     = uri();
        $params  = $session->get($key);
        $data    = [];
        foreach ($params as $name => $values) {
            if (isset($values['column']) && $values['column'] == $column) {
                continue;
            }
            $data[$name] = $values;
        }
        $session->put($key, $data);
        $session->save();
        return response('', 200);
    }
737894
public function delete()
    {
        $memoryTableAnnotation = ModelManager::getAnnotation($this, MemoryTable::class);
        if(null === $memoryTableAnnotation)
        {
            return null;
        }
        MemoryTableManager::del($memoryTableAnnotation->name, $this->__key);
    }
930855
public function deletePage()
    {
        // Get dependencies
        $pageMapper = ($this->container->dataMapper)('PageMapper');
        $pageElementMapper = ($this->container->dataMapper)('PageElementMapper');
        $pageSettingMapper = ($this->container->dataMapper)('PageSettingMapper');

        $pageId = empty($this->request->getParsedBodyParam('id')) ? null : $this->request->getParsedBodyParam('id');

        if (null !== $pageId) {
            // Ensure this is not the home page
            $page = $pageMapper->findById($pageId);

            if ($page->slug === 'home') {
                throw new Exception('PitonCMS: Cannot delete home page');
            }

            // Delete page
            $pageMapper->delete($page);

            // Delete page elements & page settings
            $pageElementMapper->deleteElementsByPageId($pageId);
            $pageSettingMapper->deleteByPageId($pageId);
        }

        // Redirect back to show pages
        return $this->redirect('adminPages');
    }
1035710
public function deleteAll()
    {
        $request = new DeleteAllFriendRequest($this->identifier);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
568627
public function deleteAction()
    {
        $model = $this->getModel();
        $model->applyRequest($this->getRequest());

        $model->delete();
        $this->_reroute(array($this->getRequest()->getActionKey() => 'index', MUTil_Model::REQUEST_ID => null));
    }