I'm trying to add validation to Universal Module to ensure that no service with the same service field "hostname" is already provisioned. (That is, the hostname should be unique.) Universal Module doesn't yet offer a way to ensure a field is unique.
These services are manually activated. To validate, I'm writing a custom validation function that interrogates the tables "service_fields" and "services." Conditions I need to ensure:
1) There is not a service_fields row with our hostname that corresponds with a services row with a status of "active" or "suspended"
2) There is not a service_fields row with our hostname that corresponds with a services row with a status of "pending" or "active" or "suspended" and a non-matching client_id.
Ideally, I'd also like to ensure that
3) There is not a service_fields row with our hostname that corresponds with a services row with a status of "pending" and with a non-matching service_id.
What do I need to change to have the services.id integer available in the function validateService? It's ok if it is NULL because no row yet exists for the service being validated, such as at order time instead of activation time.
Alternatively, is it possible to call different validation functions at order time and at activation time?
Question
will
I'm trying to add validation to Universal Module to ensure that no service with the same service field "hostname" is already provisioned. (That is, the hostname should be unique.) Universal Module doesn't yet offer a way to ensure a field is unique.
These services are manually activated. To validate, I'm writing a custom validation function that interrogates the tables "service_fields" and "services." Conditions I need to ensure:
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.