Missing docstring.

Missing docstring for ValidationAbstractType. Check Documenter's build log for details.

Missing docstring.

Missing docstring for ValidationResult. Check Documenter's build log for details.

Missing docstring.

Missing docstring for ValidationError. Check Documenter's build log for details.

SearchLight.Validation.ValidationRuleType

Creates Validation rule for a Model's field

Examples

julia> function not_empty(field::Symbol, m::T, args::Vararg{Any})::ValidationResult where {T<:AbstractModel}
         isempty(getfield(m, field)) && return ValidationResult(invalid, :not_empty, "should not be empty")
         
         ValidationResult(valid)
       end

julia> function is_int(field::Symbol, m::T, args::Vararg{Any})::ValidationResult where {T<:AbstractModel}
         isa(getfield(m, field), Int) || return ValidationResult(invalid, :is_int, "should be an int")
         
         ValidationResult(valid)
       end

julia> function is_unique(field::Symbol, m::T, args::Vararg{Any})::ValidationResult where {T<:AbstractModel}
         obj = findone(typeof(m); NamedTuple(field => getfield(m, field))... )
         if ( obj !== nothing && ! ispersisted(m) )
           return ValidationResult(invalid, :is_unique, "already exists")
         end

         ValidationResult(valid)
       end

julia> ValidationRule(:username, not_empty)
julia> ValidationRule(:username, is_unique)
julia> ValidationRule(:age, is_int)
julia> ValidationRule(:email, not_empty)
source
Missing docstring.

Missing docstring for validator. Check Documenter's build log for details.

SearchLight.Validation.validateFunction
validate(m::T)::Bool where {T<:AbstractModel}

Validates m's data. A bool is return and existing errors are pushed to the validator's error stack.

source
Missing docstring.

Missing docstring for haserrors. Check Documenter's build log for details.

Missing docstring.

Missing docstring for haserrorsfor. Check Documenter's build log for details.

Missing docstring.

Missing docstring for errorsfor. Check Documenter's build log for details.

Missing docstring.

Missing docstring for errorsmessagesfor. Check Documenter's build log for details.

Missing docstring.

Missing docstring for errors_to_string. Check Documenter's build log for details.