dbmsv2/app/Cells/Equipment/PartCell.php
2025-09-25 08:59:07 +09:00

32 lines
993 B
PHP

<?php
namespace App\Cells\Equipment;
use App\Services\Equipment\PartService;
class PartCell extends EquipmentCell
{
public function __construct()
{
parent::__construct(new PartService());
}
public function parttable(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$types = array_key_exists('types', $params) ? $params['types'] : SERVERPART['STOCK_PARTTYPES'];
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/part/' . $template, [
'partCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'entities' => $this->getService()->getEntities("type IN (" . "'" . implode("','", $types) . "'" . ")"),
],
]);
}
}