24 lines
773 B
PHP
Executable File
24 lines
773 B
PHP
Executable File
<?php
|
|
namespace App\Models;
|
|
use CodeIgniter\Model;
|
|
class InvoiceChildModel extends Model
|
|
{
|
|
protected $table = 'invoice_child';
|
|
protected $primaryKey = 'invoice_child_id';
|
|
protected $allowedFields = ['invoice_child_id','invoice_id','product_id', 'net_price','qty','discount_type','discount','total','tax','amount','isactive','labour_cost'];
|
|
protected $beforeInsert = ['setCreatedBy'];
|
|
protected $beforeUpdate = ['setUpdatedBy'];
|
|
|
|
protected function setCreatedBy(array $data)
|
|
{
|
|
$data['data']['created_by'] = (int) session()->get('logged_user');
|
|
return $data;
|
|
}
|
|
|
|
protected function setUpdatedBy(array $data)
|
|
{
|
|
$data['data']['updated_by'] = (int) session()->get('logged_user');
|
|
return $data;
|
|
}
|
|
|
|
} |