Delete a group

@author Steve Montambeault
@link   http://stevemo.ca

@param $id

@return void

@throws \Cartalyst\Sentry\Groups\GroupNotFoundException
965034
public function delete($id)
    {
        $group = $this->findById($id);
        $old = $group;
        $group->delete();
        $this->event->fire('groups.delete', array($old));
    }
49752
public static function destroy($id) 
    {
        try {
            $file = self::find($id);
            
            if($file->descendants()->exists()) {
                foreach($file->descendants()->where('type', '!=', 'folder')->get() as $descendant) {
                    
                    event(new FileWasDeleted([ // fire 'file deleted' event for each descendant
                        'file' => $descendant
                    ]));
                }
            }
            
            $file->delete($id);

            if($file->type != 'folder') {
                event(new FileWasDeleted([ // fire 'file deleted' event for file
                    'file' => $file
                ]));
            }
        }
        
        catch (Exception $e) {
            throw $e;
        }
    }
30402
public function actionDelete($id)
	{
		//$this->loadModel($id)->delete();

		// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
		//if(!isset($_GET['ajax']))
		//	$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
                
                
                
                $model = $this->loadModel($id);
				
		$sql = 'ALTER TABLE '.BaseCccdCompanyData::model()->tableName().' DROP `'.$model->varname.'`';
				if ($model->dbConnection->createCommand($sql)->execute()) {
					$model->delete();
				}
			

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

	}
907289
public static function remove($id)
    {
        if (isset(self::$list[$id])) {
            self::$list[$id]->free();
        }
    }
939962
public function deleteTable($id)
    {
        if (isset($this[$id])) {
            Common::destroy($this[$id]);
            $this->setTableDeleted($id);
        }
    }
517295
public function destroy($id)
    {
        $this->guardAgainstMissingParent('destroy');

        $this->shopify->delete($this->path($id));
    }
105229
public function delete($id)
    {
        // TODO: move order to an archive instead of removing it from database
        $order = $this->orderRepository->findById($id);

        if (!$order) {
            throw new OrderNotFoundException($id);
        }

        $this->em->remove($order);
        $this->em->flush();
    }
971653
public function groupDelete($group_id){
        $params=array(
            'group_id'=>$group_id
        );
        $rst = $this->_request->post($this->_url . 'group/delete', $params);
        return $this->_client->rst($rst);
    }
701352
public function destroy($id)
    {
        try
        {
            $this->groups->delete($id);

            return Redirect::route('cpanel.groups.index')
                ->with('success', Lang::get('cpanel::groups.delete_success'));
        }
        catch (GroupNotFoundException $e)
        {
            return Redirect::back()->with('error', $e->getMessage());
        }
    }
402143
public function findById($id)
	{
		$model = $this->createModel();

		$group = $model->where('id', '=', $id)->find();

		if ( ! $group->loaded() )
		{
			throw new GroupNotFoundException("A group could not be found with ID [$id].");
		}

		return $group;
	}
962841
public function _destroy($id) {
        ORM::for_table($this->sessions_table)->raw_execute("DELETE FROM " . $this->sessions_table . " WHERE id = :id", ['id' => $id]);
    }
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;
        }
    }
72516
public function delete($id)
    {
        $entity = $this->findById($id);
        $entity = $this->beforeDelete($entity);

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

        $this->afterDelete($entity);
    }
568690
public function delete($id)
    {
        $istance = $this->getById($id);

        if (! $istance)
        {
            return false;
        }

        return $istance->delete();
    }
889125
public function delete($id)
    {
        $this->innerHandler->delete($id);
        // Delete by primary key will remove the object, so we don't need to clear `ez-language-code-` here.
        $this->cache->deleteMulti(['ez-language-' . $id, 'ez-language-list']);
    }
783739
public function deleteRow ($id)
		{
			$this->database->createQuery()
				->delete()
				->from($this->table)
				->where(
					$this->database->createCondition()
						->equal($this->getPrimaryKey(), $id)
				)
				->execute();
		}
314425
public function delete($id)
    {
        $entity = $this->get($id);

        $this->manager->remove($entity);
        $this->manager->flush();
    }