<?php

namespace App\Cells\Part;

use App\Services\Part\DISKService;

class DISKCell extends PartCell
{
  public function __construct()
  {
    parent::__construct(new DISKService());
  }

  public function stock(array $params): string
  {
    $this->getService()->setAction(__FUNCTION__);
    $this->getService()->setFormFields();
    $this->getService()->setFormFilters();
    $this->getService()->setFormRules();
    $this->getService()->setFormOptions();
    $template = array_key_exists('template', $params) ? $params['template'] : 'disk_stock';
    return view('cells/part/' . $template, [
      'partCellDatas' => [
        'control'      => $this->getService()->getControlDatas(),
        'service'      => $this->getService(),
        'entities' => $this->getService()->getEntities(),
      ],
    ]);
  }
}
