/** * method deleteCollection() * Delete many records */ public function deleteCollection($param) { // decode json with record id's $selected = json_decode($param['selected']); try { TTransaction::open('sample'); if ($selected) { // delete each record from collection foreach ($selected as $id) { $object = new email(); $object->delete($id); } $posAction = new TAction(array($this, 'onReload')); $posAction->setParameters($param); new TMessage('info', AdiantiCoreTranslator::translate('Records deleted'), $posAction); } TTransaction::close(); } catch (Exception $e) { new TMessage('error', $e->getMessage()); TTransaction::rollback(); } }
<center> <br/> <h1>Deleted from the list</h1> </center> <?php function __autoload($className) { $fullPath = $className . ".php"; $finalDis = "/../../../" . str_replace("\\", "/", $fullPath); //echo $finalDis; include_once $finalDis; } use src\Bitm\SEIP117637\Email\Email; $email = new email(); $email->delete(); echo "<hr>";