Automation/app/Libraries/Mangboard/FreeboardLibrary.php
2024-09-06 01:10:56 +09:00

32 lines
827 B
PHP

<?php
namespace App\Libraries\Mangboard;
use App\Entities\Mangboard\FreeboardEntity;
use App\Models\Mangboard\FreeboardModel;
class FreeboardLibrary extends MangboardLibrary
{
private $_model = null;
public function __construct()
{
parent::__construct();
}
private function getModel(): FreeboardModel
{
if ($this->_model === null) {
$this->_model = new FreeboardModel();
}
return $this->_model;
}
public function create(FreeboardEntity $entity, array $formDatas = []): FreeboardEntity
{
$this->getModel()->setCreateField(); //Create용 Field,Rule지정
$entity = $this->getModel()->create($entity, $formDatas);
log_message("debug", __FUNCTION__ . "=>등록이 완료되었습니다.");
return $entity;
}
}