42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class AgentIncentiveFileModel extends Model
|
|
{
|
|
protected $table = 'partner_agent_incentive_file';
|
|
protected $primaryKey = 'id';
|
|
protected $useAutoIncrement = true;
|
|
|
|
// Fields allowed for insert/update
|
|
protected $allowedFields = [
|
|
'agent_id',
|
|
'incentive_month',
|
|
'incentive_file_name',
|
|
'file_type',
|
|
'is_active',
|
|
'created_by',
|
|
'created_on',
|
|
'updated_by',
|
|
'updated_on'
|
|
];
|
|
|
|
// Automatically manage created/updated timestamps
|
|
protected $useTimestamps = false; // we already handle manually in table
|
|
protected $createdField = 'created_on';
|
|
protected $updatedField = 'updated_on';
|
|
|
|
// Return result as array
|
|
protected $returnType = 'array';
|
|
|
|
// Validation rules (optional, add as per your need)
|
|
protected $validationRules = [
|
|
'agent_id' => 'permit_empty|integer',
|
|
'incentive_month' => 'required|valid_date',
|
|
'incentive_file_name' => 'required|string|max_length[150]',
|
|
'file_type' => 'permit_empty|max_length[50]'
|
|
];
|
|
}
|