51 lines
1.6 KiB
PHP
Executable File
51 lines
1.6 KiB
PHP
Executable File
<?php
|
||
|
||
namespace App\Models;
|
||
|
||
use CodeIgniter\Model;
|
||
|
||
class PartnerStaffModel extends Model
|
||
{
|
||
protected $table = 'partner_staff'; // table name
|
||
protected $primaryKey = 'id'; // primary key
|
||
|
||
protected $useAutoIncrement = true;
|
||
|
||
// return results as array
|
||
protected $returnType = 'array';
|
||
protected $useSoftDeletes = false;
|
||
|
||
// allowed fields for insert/update
|
||
protected $allowedFields = ['name','email','mobile','emp_id','role_id','email_otp','is_active','created_by','updated_by','manager_id'];
|
||
|
||
// automatic timestamps
|
||
protected $useTimestamps = true;
|
||
protected $createdField = 'created_on';
|
||
protected $updatedField = 'updated_on';
|
||
protected $dateFormat = 'datetime';
|
||
|
||
// validation rules
|
||
// protected $validationRules = [
|
||
// 'name' => 'required|min_length[2]|max_length[150]',
|
||
// 'email' => 'permit_empty|valid_email|max_length[150]',
|
||
// 'mobile' => 'permit_empty|regex_match[/^[0-9]{10,20}$/]',
|
||
// ];
|
||
|
||
// protected $validationMessages = [
|
||
// 'name' => [
|
||
// 'required' => 'Name is required',
|
||
// 'min_length' => 'Name must have at least 2 characters',
|
||
// 'max_length' => 'Name cannot exceed 150 characters'
|
||
// ],
|
||
// 'email' => [
|
||
// 'valid_email' => 'Please provide a valid email address',
|
||
// 'max_length' => 'Email cannot exceed 150 characters'
|
||
// ],
|
||
// 'mobile' => [
|
||
// 'regex_match' => 'Mobile number must be 10–20 digits only'
|
||
// ]
|
||
// ];
|
||
|
||
// protected $skipValidation = false;
|
||
}
|