Exemplo n.º 1
0
 public function delete($restriction_id)
 {
     $output = new stdClass();
     $output->status = FALSE;
     $output->message = '';
     $this->_transaction_isolation();
     $this->db->trans_begin();
     $restriction = new Restriction();
     $restriction->get_by_id((int) $restriction_id);
     if ($restriction->exists()) {
         $restriction->delete();
         $this->db->trans_commit();
         $output->status = TRUE;
         $output->message = $this->lang->line('admin_restrictions_messages_restriction_delete_successfully');
     } else {
         $this->db->trans_rollback();
         $output->message = $this->lang->line('admin_restrictions_messages_restriction_deletion_failed');
     }
     $this->output->set_content_type('application/json');
     $this->output->set_output(json_encode($output));
 }