<?php

namespace App\Models\Equipment\Link;

use App\Models\Equipment\EquipmentModel;

abstract class LinkModel extends EquipmentModel
{
    protected function __construct()
    {
        parent::__construct();
    }
    final public function getFieldRule(string $action, string $field): string
    {
        if (is_array($field)) {
            throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
        }
        switch ($field) {
            case "serverinfo_uid":
            case "cpuinfo_uid":
            case "raminfo_uid":
            case "diskinfo_uid":
                $rule = "required|numeric";
                break;
            default:
                $rule = parent::getFieldRule($action, $field);
                break;
        }
        return $rule;
    }
}
