Show:

This class is private and is only used by ResultCollection

Methods

_handlePromise () private

Promise handler

update
(
  • result
)
private

Update the current validation result object with the given result

  • If result is undefined or null, set isValid to false
  • If result is a validations object from a different model/object, set the _validations object to the one given (belongs-to)
  • If result is a collection of result objects, create a Validation Result Collection and set that to the _validations object (has-many)
  • If result is a string, set the message to the given string and set isValid to false
  • If result is a boolean, set isValid to result
  • If result is a pojo, update _validations object with the information given

Parameters:

Properties

_promise

Promise private

_validations

Result private

This hold all the logic for the above CPs. We do this so we can easily switch this object out with a different validations object

_validator

Validator private

The validator that returned this result

attribute

String