57 lines
1.7 KiB
PHP
Executable File
57 lines
1.7 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class PartnerManagerIncentiveFileModel extends Model
|
|
{
|
|
protected $table = 'partner_manager_incentive_file';
|
|
protected $primaryKey = 'id';
|
|
protected $useAutoIncrement = true;
|
|
|
|
protected $returnType = 'array'; // or 'object'
|
|
protected $useSoftDeletes = false;
|
|
|
|
protected $allowedFields = [
|
|
'manager_id',
|
|
'incentive_month',
|
|
'incentive_file_name',
|
|
'is_active',
|
|
'created_by',
|
|
'created_on',
|
|
'updated_by',
|
|
'updated_on'
|
|
];
|
|
|
|
// Timestamps
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_on';
|
|
protected $updatedField = 'updated_on';
|
|
protected $dateFormat = 'datetime'; // can be 'date' or 'int'
|
|
|
|
// Validation Rules (optional, can add more)
|
|
// protected $validationRules = [
|
|
// 'manager_id' => 'required|integer',
|
|
// 'incentive_month' => 'required|valid_date',
|
|
// 'incentive_file_name'=> 'required|string|max_length[150]',
|
|
// ];
|
|
|
|
// protected $validationMessages = [
|
|
// 'manager_id' => [
|
|
// 'required' => 'Manager ID is required',
|
|
// 'integer' => 'Manager ID must be a number',
|
|
// ],
|
|
// 'incentive_month' => [
|
|
// 'required' => 'Incentive Month is required',
|
|
// 'valid_date' => 'Incentive Month must be a valid date (Y-m-d)',
|
|
// ],
|
|
// 'incentive_file_name' => [
|
|
// 'required' => 'File name is required',
|
|
// 'max_length' => 'File name cannot exceed 150 characters',
|
|
// ],
|
|
// ];
|
|
|
|
// protected $skipValidation = false;
|
|
}
|