riainvoice/application/core/Response_Model.php
gandhimathi Bharathirajan c940cb1a2c all files
2017-09-11 14:38:03 +05:30

46 lines
1.1 KiB
PHP

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
* InvoicePlane
*
* @author InvoicePlane Developers & Contributors
* @copyright Copyright (c) 2012 - 2017 InvoicePlane.com
* @license https://invoiceplane.com/license.txt
* @link https://invoiceplane.com
*/
/**
* Class Response_Model
*/
class Response_Model extends Form_Validation_Model
{
/**
* @param null|int $id
* @param null|array $db_array
* @return null|int
*/
public function save($id = null, $db_array = null)
{
if ($id) {
$this->session->set_flashdata('alert_success', trans('record_successfully_updated'));
parent::save($id, $db_array);
} else {
$this->session->set_flashdata('alert_success', trans('record_successfully_created'));
$id = parent::save(null, $db_array);
}
return $id;
}
/**
* @param int $id
*/
public function delete($id)
{
parent::delete($id);
$this->session->set_flashdata('alert_success', trans('record_successfully_deleted'));
}
}