dbmsv3/app/Cells/SearchCell.php
2025-10-20 10:25:29 +09:00

32 lines
733 B
PHP

<?php
namespace App\Cells;
use App\Cells\CommonCell;
use App\Services\Customer\ClientService;
class SearchCell extends CommonCell
{
public function __construct()
{
parent::__construct(new ClientService());
}
public function client(array $params): string
{
$options = ["" => "고객명 선택"];
foreach ($this->getService()->getEntities() as $entity) {
$options[$entity->getPK()] = $entity->getTitle();
}
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/search/' . $template, [
'searchCellDatas' => [
'service' => $this->getService(),
'options' => $options,
'selected' => null,
]
]);
}
}