32 lines
993 B
PHP
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) . "'" . ")"),
|
|
],
|
|
]);
|
|
}
|
|
}
|