dbmsv4/app/Cells/SearchCell.php
2026-01-13 10:42:08 +09:00

31 lines
732 B
PHP

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