<?php

namespace App\Helpers\Part;

use App\Models\Part\SWITCHModel;

class SWITCHHelper extends PartHelper
{
    public function __construct()
    {
        parent::__construct();
        $this->setTitleField(field: SWITCHModel::TITLE);
    }

    public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
    {
        switch ($action) {
            case 'modify':
                $action = parent::getListButton($action,   $viewDatas['entity']->getCode(), $viewDatas, $extras);
                break;
            default:
                $action = parent::getListButton($action, $label, $viewDatas, $extras);
                break;
        }
        return $action;
    }
}
