51 lines
1.0 KiB
PHP
51 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Helpers\BoardHelper;
|
|
use App\Models\BoardModel;
|
|
|
|
class BoardService extends CommonService
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct(new BoardModel(), new BoardHelper());
|
|
$this->addClassName('Board');
|
|
}
|
|
public function getFormFields(): array
|
|
{
|
|
return [
|
|
'category',
|
|
'title',
|
|
'content',
|
|
'status',
|
|
];
|
|
}
|
|
public function getFormFilters(): array
|
|
{
|
|
return [
|
|
'category',
|
|
'status',
|
|
];
|
|
}
|
|
public function getIndexFields(): array
|
|
{
|
|
return [
|
|
'category',
|
|
'title',
|
|
'status',
|
|
'created_at',
|
|
];
|
|
}
|
|
public function getBatchjobFields(): array
|
|
{
|
|
return ['category', 'status'];
|
|
}
|
|
public function latest(array $where, int $limit = 3): array
|
|
{
|
|
$this->getModel()->limit($limit);
|
|
return $this->getEntities($where);
|
|
}
|
|
//기본 기능부분
|
|
}
|