<?php

namespace App\Cells\Part;

use App\Services\Part\RAMService;

class RAMCell extends PartCell
{
  public function __construct()
  {
    parent::__construct(new RAMService());
  }

  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'] : 'ram_stock';
    return view('cells/part/' . $template, [
      'partCellDatas' => [
        'control'      => $this->getService()->getControlDatas(),
        'service'      => $this->getService(),
        'entities' => $this->getService()->getEntities(),
      ],
    ]);
  }
}
