delete() public static method

Delete (multiple) items from locale
public static delete ( array $ids )
$ids array The id(s) to delete.
Example #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendLocaleModel::exists($this->id) && BackendAuthentication::getUser()->isGod()) {
         parent::execute();
         // filter options
         $this->setFilter();
         // get data
         $this->record = (array) BackendLocaleModel::get($this->id);
         // delete item
         BackendLocaleModel::delete(array($this->id));
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
         // build redirect URL
         $redirectUrl = BackendModel::createURLForAction('Index') . '&report=deleted&var=' . urlencode($this->record['name'] . ' (' . strtoupper($this->record['language']) . ')') . $this->filterQuery;
         // item was deleted, so redirect
         $this->redirect($redirectUrl);
     } else {
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }