Validate an operation

@param OperationInterface $operation
@return bool
@throws AlreadyCreatedOperationException
@throws InvalidOperationException
484963
public function isOperationValid(OperationInterface $operation)
    {
        if ($this->operationManager->findByMiraklIdAndPaymentVoucherNumber(
            $operation->getMiraklId(),
            $operation->getPaymentVoucher()
        )
        ) {
            throw new AlreadyCreatedOperationException($operation);
        }

        if (!$this->operationManager->isValid($operation)) {
            throw new InvalidOperationException($operation);
        }

        ModelValidator::validate($operation);

        return true;
    }
329230
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString withdefaults_validator = new MPSString();
		withdefaults_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 32);
		withdefaults_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		withdefaults_validator.validate(operationType, withdefaults, "\"withdefaults\"");
		
		MPSString response_validator = new MPSString();
		response_validator.validate(operationType, response, "\"response\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
1309250
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString response_validator = new MPSString();
		response_validator.validate(operationType, response, "\"response\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
299162
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
1057590
protected function validateOperations() {
		$errors	= 0;
		foreach( $this->operations as $operation ) {
			$operation->setTransactionOperationSet($this);
			$operation->validate($errors);
		}
	}
723261
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSInternetHost server_name_validator = new MPSInternetHost();
		server_name_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		server_name_validator.validate(operationType, server_name, "\"server_name\"");
		
		MPSInt port_validator = new MPSInt();
		port_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 1);
		port_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 65534);
		port_validator.validate(operationType, port, "\"port\"");
		
		MPSString username_validator = new MPSString();
		username_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		username_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		username_validator.validate(operationType, username, "\"username\"");
		
		MPSString password_validator = new MPSString();
		password_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		password_validator.validate(operationType, password, "\"password\"");
		
		MPSBoolean is_auth_validator = new MPSBoolean();
		is_auth_validator.validate(operationType, is_auth, "\"is_auth\"");
		
		MPSBoolean is_ssl_validator = new MPSBoolean();
		is_ssl_validator.validate(operationType, is_ssl, "\"is_ssl\"");
		
	}
935702
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSInt polling_interval_validator = new MPSInt();
		polling_interval_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 1);
		polling_interval_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 1000);
		polling_interval_validator.validate(operationType, polling_interval, "\"polling_interval\"");
		
		MPSString interval_unit_validator = new MPSString();
		interval_unit_validator.validate(operationType, interval_unit, "\"interval_unit\"");
		
	}
361794
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString bay_number_validator = new MPSString();
		bay_number_validator.validate(operationType, bay_number, "\"bay_number\"");
		
		MPSString name_validator = new MPSString();
		name_validator.validate(operationType, name, "\"name\"");
		
		MPSDoubleLong utilized_validator = new MPSDoubleLong();
		utilized_validator.validate(operationType, utilized, "\"utilized\"");
		
		MPSDoubleLong size_validator = new MPSDoubleLong();
		size_validator.validate(operationType, size, "\"size\"");
		
		MPSString status_validator = new MPSString();
		status_validator.validate(operationType, status, "\"status\"");
		
		MPSIPAddress host_ip_address_validator = new MPSIPAddress();
		host_ip_address_validator.validate(operationType, host_ip_address, "\"host_ip_address\"");
		
		MPSString act_id_validator = new MPSString();
		act_id_validator.validate(operationType, act_id, "\"act_id\"");
		
	}
994161
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString propkey_validator = new MPSString();
		propkey_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		propkey_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 256);
		propkey_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		propkey_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		propkey_validator.validate(operationType, propkey, "\"propkey\"");
		
		MPSString propvalue_validator = new MPSString();
		propvalue_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 2000);
		propvalue_validator.validate(operationType, propvalue, "\"propvalue\"");
		
	}
645643
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSIPAddress xen_ip_address_validator = new MPSIPAddress();
		xen_ip_address_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		xen_ip_address_validator.validate(operationType, xen_ip_address, "\"xen_ip_address\"");
		
		MPSIPAddress netmask_validator = new MPSIPAddress();
		netmask_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		netmask_validator.validate(operationType, netmask, "\"netmask\"");
		
		MPSIPAddress gateway_validator = new MPSIPAddress();
		gateway_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		gateway_validator.validate(operationType, gateway, "\"gateway\"");
		
		MPSIPAddress svm_ip_address_validator = new MPSIPAddress();
		svm_ip_address_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		svm_ip_address_validator.validate(operationType, svm_ip_address, "\"svm_ip_address\"");
		
		MPSIPAddress dns_validator = new MPSIPAddress();
		dns_validator.validate(operationType, dns, "\"dns\"");
		
		MPSString network_interface_validator = new MPSString();
		network_interface_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 15);
		network_interface_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		network_interface_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		network_interface_validator.validate(operationType, network_interface, "\"network_interface\"");
		
	}
613542
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSBoolean ntpd_status_validator = new MPSBoolean();
		ntpd_status_validator.validate(operationType, ntpd_status, "\"ntpd_status\"");
		
	}
1012134
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString platform_validator = new MPSString();
		platform_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 64);
		platform_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		platform_validator.validate(operationType, platform, "\"platform\"");
		
		MPSInt max_number_of_ns_instances_validator = new MPSInt();
		max_number_of_ns_instances_validator.validate(operationType, max_number_of_ns_instances, "\"max_number_of_ns_instances\"");
		
		MPSString max_throughput_validator = new MPSString();
		max_throughput_validator.validate(operationType, max_throughput, "\"max_throughput\"");
		
		MPSString available_throughput_validator = new MPSString();
		available_throughput_validator.validate(operationType, available_throughput, "\"available_throughput\"");
		
		MPSInt max_number_of_br_instances_validator = new MPSInt();
		max_number_of_br_instances_validator.validate(operationType, max_number_of_br_instances, "\"max_number_of_br_instances\"");
		
		MPSInt available_number_of_ns_instances_validator = new MPSInt();
		available_number_of_ns_instances_validator.validate(operationType, available_number_of_ns_instances, "\"available_number_of_ns_instances\"");
		
		MPSInt max_number_of_instances_validator = new MPSInt();
		max_number_of_instances_validator.validate(operationType, max_number_of_instances, "\"max_number_of_instances\"");
		
		MPSInt available_number_of_instances_validator = new MPSInt();
		available_number_of_instances_validator.validate(operationType, available_number_of_instances, "\"available_number_of_instances\"");
		
		MPSBoolean sync_operation_validator = new MPSBoolean();
		sync_operation_validator.validate(operationType, sync_operation, "\"sync_operation\"");
		
		MPSString act_id_validator = new MPSString();
		act_id_validator.validate(operationType, act_id, "\"act_id\"");
		
	}
1079713
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString ssl_certificate_validator = new MPSString();
		ssl_certificate_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		ssl_certificate_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		ssl_certificate_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		ssl_certificate_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		ssl_certificate_validator.validate(operationType, ssl_certificate, "\"ssl_certificate\"");
		
		MPSString ssl_key_validator = new MPSString();
		ssl_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		ssl_key_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		ssl_key_validator.validate(operationType, ssl_key, "\"ssl_key\"");
		
		MPSString password_validator = new MPSString();
		password_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 32);
		password_validator.validate(operationType, password, "\"password\"");
		
		MPSBoolean reboot_validator = new MPSBoolean();
		reboot_validator.validate(operationType, reboot, "\"reboot\"");
		
		MPSString cert_format_validator = new MPSString();
		cert_format_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 64);
		cert_format_validator.validate(operationType, cert_format, "\"cert_format\"");
		
		MPSInt days_to_expiry_validator = new MPSInt();
		days_to_expiry_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0);
		days_to_expiry_validator.validate(operationType, days_to_expiry, "\"days_to_expiry\"");
		
		MPSString status_validator = new MPSString();
		status_validator.validate(operationType, status, "\"status\"");
		
		MPSString version_validator = new MPSString();
		version_validator.validate(operationType, version, "\"version\"");
		
		MPSInt serial_number_validator = new MPSInt();
		serial_number_validator.validate(operationType, serial_number, "\"serial_number\"");
		
		MPSString signature_algorithm_validator = new MPSString();
		signature_algorithm_validator.validate(operationType, signature_algorithm, "\"signature_algorithm\"");
		
		MPSString issuer_validator = new MPSString();
		issuer_validator.validate(operationType, issuer, "\"issuer\"");
		
		MPSString valid_from_validator = new MPSString();
		valid_from_validator.validate(operationType, valid_from, "\"valid_from\"");
		
		MPSString valid_to_validator = new MPSString();
		valid_to_validator.validate(operationType, valid_to, "\"valid_to\"");
		
		MPSString subject_validator = new MPSString();
		subject_validator.validate(operationType, subject, "\"subject\"");
		
		MPSString public_key_algorithm_validator = new MPSString();
		public_key_algorithm_validator.validate(operationType, public_key_algorithm, "\"public_key_algorithm\"");
		
		MPSInt public_key_size_validator = new MPSInt();
		public_key_size_validator.validate(operationType, public_key_size, "\"public_key_size\"");
		
	}
320425
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSIPAddress server_ip_validator = new MPSIPAddress();
		server_ip_validator.setConstraintIsReq(MPSConstants.GENERIC_CONSTRAINT, true);
		server_ip_validator.validate(operationType, server_ip, "\"server_ip\"");
		
		MPSInt port_validator = new MPSInt();
		port_validator.setConstraintIsReq(MPSConstants.GENERIC_CONSTRAINT, true);
		port_validator.validate(operationType, port, "\"port\"");
		
		MPSString model_validator = new MPSString();
		model_validator.setConstraintIsReq(MPSConstants.GENERIC_CONSTRAINT, true);
		model_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		model_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		model_validator.validate(operationType, model, "\"model\"");
		
		MPSIPAddress br_ip_address_arr_validator = new MPSIPAddress();
		br_ip_address_arr_validator.setConstraintIsReq(MPSConstants.GENERIC_CONSTRAINT, true);
		if(br_ip_address_arr != null)
		{
			for(int i=0; i<br_ip_address_arr.length; i++)
			{
				br_ip_address_arr_validator.validate(operationType, br_ip_address_arr[i], "br_ip_address_arr["+i+"]");
			}
		}
		
	}
1120884
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString ns_conf_upgradefile_validator = new MPSString();
		ns_conf_upgradefile_validator.validate(operationType, ns_conf_upgradefile, "\"ns_conf_upgradefile\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
	}
85418
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString diff_response_validator = new MPSString();
		diff_response_validator.validate(operationType, diff_response, "\"diff_response\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
		MPSString source_file_validator = new MPSString();
		source_file_validator.validate(operationType, source_file, "\"source_file\"");
		
		MPSString target_file_validator = new MPSString();
		target_file_validator.validate(operationType, target_file, "\"target_file\"");
		
		MPSString source_command_validator = new MPSString();
		source_command_validator.validate(operationType, source_command, "\"source_command\"");
		
		MPSString target_command_validator = new MPSString();
		target_command_validator.validate(operationType, target_command, "\"target_command\"");
		
	}
1094551
private function validateOperator(string $operator)
    {
        if (!in_array($operator, self::VALID_OPERATORS)) {
            throw new \InvalidArgumentException(sprintf(
                '%s is not a valid operator'
            ), $operator);
        }
    }