cfmgrv3/app/Libraries/Log/DataBase.php
2023-06-19 13:06:49 +09:00

22 lines
505 B
PHP

<?php
namespace App\Libraries\Log;
class DataBase
{
private $_model = null;
public function __construct()
{
$this->_model = new \App\Models\LoggerModel();
}
public function save(string $title, bool $status, array $logs)
{
$entity = new \App\Entities\LoggerEntity();
$entity->user_uid = session()->get('uid');
$entity->title = $title;
$entity->content = implode("\n", $logs);
$entity->status = $status ? 'use' : 'unuse';
return $this->_model->save($entity);
}
}