dbmsv3/app/Processors/CommonProcessor.php
2025-10-29 10:21:45 +09:00

27 lines
583 B
PHP

<?php
namespace App\Processor;
use App\Services\MyLogService;
use CodeIgniter\Database\BaseConnection;
abstract class CommonProcessor
{
final protected $db = null;
final protected ?MyLogService $logService = null;
protected function __construct(BaseConnection $db)
{
$this->db = $db;
$this->logService = new MyLogService();
}
final protected function setLog(string $title, string $status, ?string $context = null): void
{
$this->logService->create([
'title' => $title,
'status' => $status,
'context' => $context
]);
}
}