Coupons::_deleteCoupon PHP Method

_deleteCoupon() private method

private _deleteCoupon ( )
    private function _deleteCoupon()
    {
        if ($this->input->post('delete')) {
            $deleted_rows = $this->Coupons_model->deleteCoupon($this->input->post('delete'));
            if ($deleted_rows > 0) {
                $prefix = $deleted_rows > 1 ? '[' . $deleted_rows . '] Coupons' : 'Coupon';
                $this->alert->set('success', sprintf($this->lang->line('alert_success'), $prefix . ' ' . $this->lang->line('text_deleted')));
            } else {
                $this->alert->set('warning', sprintf($this->lang->line('alert_error_nothing'), $this->lang->line('text_deleted')));
            }
            return TRUE;
        }
    }