clqms-be/app/Models/BaseModel.php
root 2bcdf09b55 chore: repo-wide normalization + rules test coverage
Normalize formatting/line endings across configs, controllers, models, tests, and OpenAPI specs.

Update rule expression/rule engine implementation and remove obsolete RuleAction controller/model.

Add unit tests for rule expression syntax and multi-action behavior, and include docs updates.
2026-03-16 07:24:50 +07:00

30 lines
775 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class BaseModel extends Model {
protected $beforeInsert = ['normalizeDatesToUTC'];
protected $beforeUpdate = ['normalizeDatesToUTC'];
protected $afterFind = ['convertDatesToUTCISO'];
protected $afterInsert = ['convertDatesToUTCISO'];
protected $afterUpdate = ['convertDatesToUTCISO'];
protected function normalizeDatesToUTC(array $data) {
helper('utc');
if (isset($data['data'])) {
$data['data'] = convert_array_to_utc($data['data']);
}
return $data;
}
protected function convertDatesToUTCISO(array $data) {
helper('utc');
if (isset($data['data'])) {
$data['data'] = convert_array_to_utc_iso($data['data']);
}
return $data;
}
}