dbms_primeidc/extdbms/lib/Services/HistoryService.php
2025-04-03 11:29:24 +09:00

37 lines
745 B
PHP

<?php
namespace lib\Services;
use lib\Entities\HistoryEntity as Entity;
use lib\Models\HistoryModel as Model;
class HistoryService extends CommonService
{
public function __construct()
{
parent::__construct();
}
final public function getClassName(): string
{
return "History";
}
final public function getClassPath(): string
{
return $this->getClassName();
}
public function getModelClass(): string
{
return Model::class;
}
public function getEntityClass(): string
{
return Entity::class;
}
public function getNews(int $limit = 5): array
{
$this->getModel()->orderBy($this->getModel()->getPKField(), 'DESC');
$this->getModel()->limit($limit);
return $this->getEntitys();
}
}