|
|
@@ -11,24 +11,8 @@ use ModulesGarden\Servers\ProxmoxCloudVps\App\Enum\ConfigurableOption;
|
|
|
|
|
|
class RessourceValidator extends BaseValidator
|
|
|
{
|
|
|
- use WhmcsParams;
|
|
|
- protected $additionalField;
|
|
|
- protected $minValue = 0;
|
|
|
- protected $maxValue = 0;
|
|
|
- protected $required = true;
|
|
|
-
|
|
|
- public function __construct( $additionalField, $required = true)
|
|
|
- {
|
|
|
- $this->additionalField = $additionalField;
|
|
|
- $this->required = $required;
|
|
|
- }
|
|
|
-
|
|
|
protected function validate($data, $additionalData = null)
|
|
|
{
|
|
|
- if (!$this->required && empty($data))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
$resurceManager = new ResourceManager();
|
|
|
$additionalSize = 0;
|
|
|
$templateName = (int) $additionalData->get('formData')[$this->additionalField];
|