coldbox.system.validation.validators

Class UniqueValidator

WEB-INF.cftags.component
        extended by coldbox.system.validation.validators.UniqueValidator
Class Attributes:
  • accessors : true
  •  
  • singleton
  •  
    All Implemented Interfaces:
    cachebox.build-coldbox.coldbox.system.validation.validators.IValidator

    ******************************************************************************* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com ******************************************************************************* Validates if the field has a unique value in the database, this only applies to ORM objects

    Property Summary
    type property default serializable required
    any ORMService


    true false
    any name


    true false
    Constructor Summary
    init()
    Method Summary
    any GETORMSERVICE()
    UniqueValidator SETNAME(any name)
    UniqueValidator SETORMSERVICE(any ORMService)
    string getName()
         Get the name of the validator.
    boolean validate(IValidationResult validationResult, any target, string field, [any targetValue], [any validationData])
         Will check if an incoming value validates.
     
    Methods inherited from class WEB-INF.cftags.component
    None

    Constructor Detail

    init

    public init()


    Property Detail

    ORMService

    property any ORMService

    Attributes:
    serializable - true
    required - false

    name

    property any name

    Attributes:
    serializable - true
    required - false

    Method Detail

    GETORMSERVICE

    public any GETORMSERVICE()


    SETNAME

    public UniqueValidator SETNAME(any name)

    Parameters:
    name

    SETORMSERVICE

    public UniqueValidator SETORMSERVICE(any ORMService)

    Parameters:
    ORMService

    getName

    public string getName()

    Get the name of the validator

    Specified by:
    getName in interface cachebox.build-coldbox.coldbox.system.validation.validators.IValidator

    validate

    public boolean validate(IValidationResult validationResult, any target, string field, [any targetValue], [any validationData])

    Will check if an incoming value validates

    Specified by:
    validate in interface cachebox.build-coldbox.coldbox.system.validation.validators.IValidator
    Parameters:
    validationResult - The result object of the validation
    target - The target object to validate on
    field - The field on the target object to validate on
    targetValue - The target value to validate
    validationData - The validation data the validator was created with