default = null; if (isset($input['validate'])) { $this->require = strpos($input['validate'], 'require') !== false; } if (isset($input['fieldset'])) { $this->fieldset = $input['fieldset']; } // Инициализация свойст обьетка foreach (['label', 'name', 'type', 'description', 'maxlength'] as $name) { if (isset($input[$name])) { $this->$name = $input[$name]; } } } /** * @param mixed $value */ function setValue($value): void { $this->value = $value; } function getId(): string { return $this->name . '_label'; } }