ColdFusion On Wheels 1.0.5

models
Class Wheels

WEB-INF.cftags.component
        extended by models.Wheels
Direct Known Subclasses:
Model

public class Wheels
extends WEB-INF.cftags.component

Method Summary
 string $URLEncode(string param)
 void $abort()
 void $abortInvalidRequest()
 array $addDeleteClause(array sql)
 array $addFromClause(array sql, string include)
 array $addKeyWhereClause(array sql)
 array $addOrderByClause(array sql, string order, string include)
 array $addSelectClause(array sql, string select, string include, boolean distinct, string returnAs)
 void $addToCache(string key, any value, [numeric time='[runtime expression]'], [string category='main'])
 array $addWhereClause(array sql, string where, string include, boolean $softDeleteCheck)
 array $addWhereClauseParameters(array sql, string where)
 any $assignAdapter()
 numeric $cacheCount([string category=''])
 any $cachedControllerClassExists(string name)
 any $cachedModelClassExists(string name)
 any $calculate(string type, string property, [string where=''], [string include=''], [boolean distinct='false'])
          Creates the query that needs to be run for all of the above methods
 boolean $callback(string type, [any collection=''])
 struct $cgiScope([string keys='request_method,http_x_requested_with,http_referer,server_name,path_info,script_name,query_string,remote_addr,server_port,server_protocol'])
          This copies all the variables Wheels needs from the CGI scope to the request scope
 struct $classData()
 void $clearCache([string category=''])
 any $clearControllerInitializationCache()
 any $clearModelInitializationCache()
 string $constructParams(any params)
 any $content()
 any $controller(string name)
 string $controllerFileName(string name)
 boolean $create(any parameterize)
 any $createControllerClass(string name)
 any $createInstance(any properties, boolean persisted, [numeric row='1'], [boolean base='true'])
 any $createModelClass(string name)
 any $createObjectFromRoot(string path, string fileName, string method)
 any $dbinfo()
 void $debugPoint(string name)
 struct $deprecated([string message='You are using deprecated behavior which will be removed from the next major or minor release.'], [boolean announce='true'])
 any $directory()
 struct $dollarify(struct input, string on)
 any $doubleCheckedLock(string name, string condition, string execute, [struct conditionArgs='[runtime expression]'], [struct executeArgs='[runtime expression]'], [numeric timeout='30'])
 void $dump(any var, [boolean abort='true'])
 boolean $evaluateValidationCondition()
          Evaluates the condition to determine if the validation should be executed
 array $expandedAssociations(string include)
 any $file()
 struct $findRoute()
 any $getFromCache(string key, [string category='main'])
 string $hashStruct(struct args)
 void $header()
 struct $image()
 void $include(string template)
 void $includeAndOutput(string template)
 string $includeAndReturnOutput(string $template)
 any $initModelClass(string name)
 any $initModelObject(string name, any properties, boolean persisted, [numeric row='1'], [boolean base='true'])
 void $insertDefaults(string name, struct input, [string reserved=''])
 any $invoke()
 string $keyWhereString([any properties='[runtime expression]'], [any values=''], [any keys=''])
 void $location()
 void $mail()
 any $namedReadLock(string name, any object, string method, [struct args='[runtime expression]'], [numeric timeout='30'])
 string $propertyValue(string name)
 void $registerAssociation()
          Called from the association methods above to save the data to the `class` struct of the model
 void $registerCallback(string type, string methods)
 void $registerValidation(string when)
          Called from the high level validation helpers to register the validation in the class struct of the model
 void $removeFromCache(string key, [string category='main'])
 string $routeVariables()
 any $setDefaultValues()
 void $setForeignKeyValues(struct missingMethodArguments, string keys, [boolean setToNull='false'])
 void $setObjectOrNumberToKey(struct missingMethodArguments)
 any $simpleLock(string execute, [struct executeArgs='[runtime expression]'], [numeric timeout='30'])
 string $singularizeOrPluralize(string text, string which, [numeric count='-1'], [boolean returnCount='true'])
          Called by singularize and pluralize to perform the conversion
 string $softDeleteColumn()
 boolean $softDeletion()
 void $throw()
 boolean $update(any parameterize)
 void $updatePersistedProperties()
 boolean $validate(string type)
          Runs all the validation methods setup on the object and adds errors as it finds them
 void $validateConfirmationOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesConfirmationOf method
 void $validateExclusionOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesExclusionOf method
 void $validateFormatOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesFormatOf method
 void $validateInclusionOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesInclusionOf method
 void $validateLengthOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesLengthOf method
 void $validateNumericalityOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesNumericalityOf method
 void $validateUniquenessOf()
          Adds an error if the object property fail to pass the validation setup in the @validatesUniquenessOf method
 string $validationErrorMessage(string message, string property)
          Creates nicer looking error text by humanizing the property name and capitalizing it when appropriate
 any $zip()
 string URLFor([string route=''], [string controller=''], [string action=''], [any key=''], [string params=''], [string anchor=''], [boolean onlyPath='[runtime expression]'], [string host='[runtime expression]'], [string protocol='[runtime expression]'], [numeric port='[runtime expression]'])
          Creates an internal URL based on supplied arguments
 void addError(string property, string message, [string name=''])
          Adds an error on a specific property
 void addErrorToBase(string message, [string name=''])
          Adds an error on the object as a whole (not related to any specific property)
 void addRoute(string name, string pattern, [string controller=''], [string action=''])
          Adds a new route to your application
 void afterCreate([string methods=''])
          Registers method(s) that should be called after a new object is created
 void afterDelete([string methods=''])
          Registers method(s) that should be called after an object is deleted
 void afterFind([string methods=''])
          Register method(s) that should be called after an existing object has been initialized (usually done with the findByKey or findOne method)
 void afterInitialization([string methods=''])
          Register method(s) that should be called after an object has been initialized
 void afterNew([string methods=''])
          Register method(s) that should be called after a new object has been initialized (usually done with the @new method)
 void afterSave([string methods=''])
          Registers method(s) that should be called after an object is saved
 void afterUpdate([string methods=''])
          Registers method(s) that should be called after an existing object is updated
 void afterValidation([string methods=''])
          Registers method(s) that should be called after an object is validated
 void afterValidationOnCreate([string methods=''])
          Registers method(s) that should be called after a new object is validated
 void afterValidationOnUpdate([string methods=''])
          Registers method(s) that should be called after an existing object is validated
 struct allChanges()
          Returns a struct detailing all changes that have been made on the object but not yet saved to the database
 array allErrors()
          Returns an array of all the errors on the object
 any average(string property, [string where=''], [string include=''], [boolean distinct='[runtime expression]'])
          Calculates the average value for a given property
 void beforeCreate([string methods=''])
          Registers method(s) that should be called before a new object is created
 void beforeDelete([string methods=''])
          Registers method(s) that should be called before an object is deleted
 void beforeSave([string methods=''])
          Registers method(s) that should be called before an object is saved
 void beforeUpdate([string methods=''])
          Registers method(s) that should be called before an existing object is updated
 void beforeValidation([string methods=''])
          Register method(s) that should be called before an object is validated
 void beforeValidationOnCreate([string methods=''])
          Registers method(s) that should be called before a new object is validated
 void beforeValidationOnUpdate([string methods=''])
          Registers method(s) that should be called before an existing object is validated
 void belongsTo(string name, [string class=''], [string foreignKey=''], [string joinType='[runtime expression]'])
          Sets up a `belongsTo` association between this model and the specified one
 string capitalize(string text)
          Returns the text with the first character converted to uppercase
 string changedFrom(string property)
          Returns the previous value of a property that has changed
 string changedProperties()
          Returns a list of the object properties that have been changed but not yet saved to the database
 void clearErrors([string property=''], [string name=''])
          Clears out all errors set on the object or only the ones set for a specific property or name
 string columnNames()
          Returns a list of column names in the table mapped to this model
 numeric count([string where=''], [string include=''])
          Returns the number of rows that match the arguments (or all rows if no arguments are passed in)
 any create([struct properties='[runtime expression]'], [boolean defaults='[runtime expression]'], [any parameterize='[runtime expression]'])
          Creates a new object, saves it to the database (if the validation permits it) and returns it
 void dataSource(string datasource, [string username=''], [string password=''])
          Use this method to override the data source connection information for this model
 boolean delete([any parameterize='[runtime expression]'])
          Deletes the object, which means the row is deleted from the database (unless prevented by a `beforeDelete` callback)
 numeric deleteAll([string where=''], [string include=''], [any parameterize='[runtime expression]'], [boolean instantiate='[runtime expression]'], [boolean $softDeleteCheck='true'])
          Deletes all records that match the where argument
 boolean deleteByKey(any key)
          Finds the record with the supplied key and deletes it
 boolean deleteOne([string where=''], [string order=''])
          Gets an object based on conditions and deletes it
 string deobfuscateParam(string param)
          Deobfuscates a value
 numeric errorCount([string property=''], [string name=''])
          Returns the number of errors this object has associated with it
 array errorsOn(string property, [string name=''])
          Returns an array of all errors associated with the supplied property (and error name when passed in)
 array errorsOnBase([string name=''])
          Returns an array of all errors associated with the object as a whole (not related to any specific property)
 boolean exists([any key=''], [string where=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'])
          Checks if a record exists in the table
 any findAll([string where=''], [string order='[runtime expression]'], [string select=''], [boolean distinct='false'], [string include=''], [numeric maxRows='-1'], [numeric page='0'], [numeric perPage='[runtime expression]'], [numeric count='0'], [string handle='query'], [any cache=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'], [string returnAs='[runtime expression]'], [boolean returnIncluded='[runtime expression]'], [numeric $limit='0'], [numeric $offset='0'], [boolean $softDeleteCheck='true'])
          Returns records from the database table mapped to this model according to the arguments passed in (use the `where` argument to decide which records to get, use the `order` argument to set in what order those records should be returned and so on)
 any findByKey(any key, [string select=''], [string include=''], [any cache=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'], [string returnAs='[runtime expression]'], [boolean $softDeleteCheck='true'])
          Fetches the requested record and returns it as an object
 any findOne([string where=''], [string order=''], [string select=''], [string include=''], [any cache=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'], [string returnAs='[runtime expression]'], [boolean $softDeleteCheck='true'])
          Fetches the first record found based on the `WHERE` and `ORDER BY` clauses
 any get(string name, [string functionName=''])
          Returns the current setting for the supplied variable name
 boolean hasChanged([string property=''])
          Returns `true` if the specified object property (or any if none was passed in) have been changed but not yet saved to the database
 boolean hasErrors([string property=''], [string name=''])
          Returns `true` if the object has any errors
 void hasMany(string name, [string class=''], [string foreignKey=''], [string joinType='[runtime expression]'], [string shortcut=''], [string through='[runtime expression]'])
          Sets up a `hasMany` association between this model and the specified one
 void hasOne(string name, [string class=''], [string foreignKey=''], [string joinType='[runtime expression]'])
          Sets up a `hasOne` association between this model and the specified one
 string humanize(string text)
          Returns readable text by capitalizing, converting camel casing to multiple words
 boolean isNew()
          Returns `true` if this object hasn't been saved yet (in other words no record exists in the database yet)
 string key([boolean $persisted='false'])
          Returns the value of the primary key for the object
 any maximum(string property, [string where=''], [string include=''])
          Calculates the maximum value for a given property
 any minimum(string property, [string where=''], [string include=''])
          Calculates the minimum value for a given property
 any model(string name)
          Returns a reference to the requested model so that class level methods can be called on it
 any new([struct properties='[runtime expression]'], [boolean defaults='[runtime expression]'])
          Creates a new object based on supplied properties and returns it
 string obfuscateParam(any param)
          Obfuscates a value
 any onMissingMethod(string missingMethodName, struct missingMethodArguments)
          This method handles dynamic finders, property and association methods
 string pluginNames()
          Returns a list of all installed plugins
 string pluralize(string word, [numeric count='-1'], [boolean returnCount='true'])
          Returns the plural form of the passed in word
 string primaryKey()
          Returns the name of the primary key for this model's table
 struct properties()
          Returns a structure of all the properties with their names as keys and the values of the property as values
 void property(string name, [string column=''], [string sql=''])
          Use this method to map an object property to either a table column with a different name than the property or to a specific SQL function
 string propertyNames()
          Returns a list of property names (ordered by their respective column's ordinal position in the database table)
 void reload()
          Reloads the property values of this object from the database
 boolean save([any parameterize='[runtime expression]'], [boolean defaults='[runtime expression]'])
          Saves the object if it passes validation and callbacks
 void set()
          Use to configure a global setting
 void setProperties([struct properties='[runtime expression]'])
          Allows you to set all the properties at once by passing in a structure with keys matching the property names
 string singularize(string word)
          Returns the singular form of the passed in word
 any sum(string property, [string where=''], [string include=''], [boolean distinct='[runtime expression]'])
          Calculates the sum of values for a given property
 void table(string name)
          Use this method to tell Wheels what database table to connect to for this model
 string tableName()
          Returns the name of the database table that this model is mapped to
 boolean update([struct properties='[runtime expression]'], [any parameterize='[runtime expression]'])
          Updates the object with the supplied properties and saves it to the database
 numeric updateAll([string where=''], [string include=''], [struct properties='[runtime expression]'], [any parameterize='[runtime expression]'], [boolean instantiate='[runtime expression]'], [boolean $softDeleteCheck='true'])
          Updates all properties for the records that match the where argument
 boolean updateByKey(any key, [struct properties='[runtime expression]'])
          Finds the object with the supplied key and saves it (if validation permits it) with the supplied properties and/or named arguments
 boolean updateOne([string where=''], [string order=''], [struct properties='[runtime expression]'])
          Gets an object based on the arguments used and updates it with the supplied properties
 boolean valid()
          Runs the validation on the object and returns `true` if it passes it
 void validate([string methods=''], [string if=''], [string unless=''])
          Registers method(s) that should be called to validate objects before they are saved
 void validateOnCreate([string methods=''], [string if=''], [string unless=''])
          Registers method(s) that should be called to validate new objects before they are inserted
 void validateOnUpdate([string methods=''], [string if=''], [string unless=''])
          Registers method(s) that should be called to validate existing objects before they are updated
 void validatesConfirmationOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [string if=''], [string unless=''])
          Validates that the value of the specified property also has an identical confirmation value (common when having a user type in their email address, choosing a password etc)
 void validatesExclusionOf([string properties=''], string list, [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string if=''], [string unless=''])
          Validates that the value of the specified property does not exist in the supplied list
 void validatesFormatOf([string properties=''], [string regEx=''], [string type=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string if=''], [string unless=''])
          Validates that the value of the specified property is formatted correctly by matching it against a regular expression using the `regEx` argument and/or against a built-in CFML validation type (`creditcard`, `date`, `email` etc) using the `type` argument
 void validatesInclusionOf([string properties=''], string list, [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string if=''], [string unless=''])
          Validates that the value of the specified property exists in the supplied list
 void validatesLengthOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [numeric exactly='[runtime expression]'], [numeric maximum='[runtime expression]'], [numeric minimum='[runtime expression]'], [string within='[runtime expression]'], [string if=''], [string unless=''])
          Validates that the value of the specified property matches the length requirements supplied
 void validatesNumericalityOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [boolean onlyInteger='[runtime expression]'], [string if=''], [string unless=''])
          Validates that the value of the specified property is numeric
 void validatesPresenceOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [string if=''], [string unless=''])
          Validates that the specified property exists and that its value is not blank
 void validatesUniquenessOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string scope=''], [string if=''], [string unless=''])
          Validates that the value of the specified property is unique in the database table
 
Methods inherited from class WEB-INF.cftags.component
 

Method Detail

$URLEncode

public string $URLEncode(string param)

Parameters:
param

$abort

public void $abort()


$abortInvalidRequest

public void $abortInvalidRequest()


$addDeleteClause

public array $addDeleteClause(array sql)

Parameters:
sql

$addFromClause

public array $addFromClause(array sql, string include)

Parameters:
sql
include

$addKeyWhereClause

public array $addKeyWhereClause(array sql)

Parameters:
sql

$addOrderByClause

public array $addOrderByClause(array sql, string order, string include)

Parameters:
sql
order
include

$addSelectClause

public array $addSelectClause(array sql, string select, string include, boolean distinct, string returnAs)

Parameters:
sql
select
include
distinct
returnAs

$addToCache

public void $addToCache(string key, any value, [numeric time='[runtime expression]'], [string category='main'])

Parameters:
key
value
time
category

$addWhereClause

public array $addWhereClause(array sql, string where, string include, boolean $softDeleteCheck)

Parameters:
sql
where
include
$softDeleteCheck

$addWhereClauseParameters

public array $addWhereClauseParameters(array sql, string where)

Parameters:
sql
where

$assignAdapter

public any $assignAdapter()


$cacheCount

public numeric $cacheCount([string category=''])

Parameters:
category

$cachedControllerClassExists

public any $cachedControllerClassExists(string name)

Parameters:
name

$cachedModelClassExists

public any $cachedModelClassExists(string name)

Parameters:
name

$calculate

public any $calculate(string type, string property, [string where=''], [string include=''], [boolean distinct='false'])
Creates the query that needs to be run for all of the above methods.

Parameters:
type
property
where
include
distinct

$callback

public boolean $callback(string type, [any collection=''])

Parameters:
type
collection

$cgiScope

public struct $cgiScope([string keys='request_method,http_x_requested_with,http_referer,server_name,path_info,script_name,query_string,remote_addr,server_port,server_protocol'])
This copies all the variables Wheels needs from the CGI scope to the request scope.

Parameters:
keys

$classData

public struct $classData()


$clearCache

public void $clearCache([string category=''])

Parameters:
category

$clearControllerInitializationCache

public any $clearControllerInitializationCache()


$clearModelInitializationCache

public any $clearModelInitializationCache()


$constructParams

public string $constructParams(any params)

Parameters:
params

$content

public any $content()


$controller

public any $controller(string name)

Parameters:
name

$controllerFileName

public string $controllerFileName(string name)

Parameters:
name

$create

public boolean $create(any parameterize)

Parameters:
parameterize

$createControllerClass

public any $createControllerClass(string name)

Parameters:
name

$createInstance

public any $createInstance(any properties, boolean persisted, [numeric row='1'], [boolean base='true'])

Parameters:
properties
persisted
row
base

$createModelClass

public any $createModelClass(string name)

Parameters:
name

$createObjectFromRoot

public any $createObjectFromRoot(string path, string fileName, string method)

Parameters:
path
fileName
method

$dbinfo

public any $dbinfo()


$debugPoint

public void $debugPoint(string name)

Parameters:
name

$deprecated

public struct $deprecated([string message='You are using deprecated behavior which will be removed from the next major or minor release.'], [boolean announce='true'])

Parameters:
message
announce

$directory

public any $directory()


$dollarify

public struct $dollarify(struct input, string on)

Parameters:
input
on

$doubleCheckedLock

public any $doubleCheckedLock(string name, string condition, string execute, [struct conditionArgs='[runtime expression]'], [struct executeArgs='[runtime expression]'], [numeric timeout='30'])

Parameters:
name
condition
execute
conditionArgs
executeArgs
timeout

$dump

public void $dump(any var, [boolean abort='true'])

Parameters:
var
abort

$evaluateValidationCondition

public boolean $evaluateValidationCondition()
Evaluates the condition to determine if the validation should be executed.


$expandedAssociations

public array $expandedAssociations(string include)

Parameters:
include

$file

public any $file()


$findRoute

public struct $findRoute()


$getFromCache

public any $getFromCache(string key, [string category='main'])

Parameters:
key
category

$hashStruct

public string $hashStruct(struct args)

Parameters:
args

$header

public void $header()


$image

public struct $image()


$include

public void $include(string template)

Parameters:
template

$includeAndOutput

public void $includeAndOutput(string template)

Parameters:
template

$includeAndReturnOutput

public string $includeAndReturnOutput(string $template)

Parameters:
$template

$initModelClass

public any $initModelClass(string name)

Parameters:
name

$initModelObject

public any $initModelObject(string name, any properties, boolean persisted, [numeric row='1'], [boolean base='true'])

Parameters:
name
properties
persisted
row
base

$insertDefaults

public void $insertDefaults(string name, struct input, [string reserved=''])

Parameters:
name
input
reserved

$invoke

public any $invoke()


$keyWhereString

public string $keyWhereString([any properties='[runtime expression]'], [any values=''], [any keys=''])

Parameters:
properties
values
keys

$location

public void $location()


$mail

public void $mail()


$namedReadLock

public any $namedReadLock(string name, any object, string method, [struct args='[runtime expression]'], [numeric timeout='30'])

Parameters:
name
object
method
args
timeout

$propertyValue

public string $propertyValue(string name)

Parameters:
name

$registerAssociation

public void $registerAssociation()
Called from the association methods above to save the data to the `class` struct of the model.


$registerCallback

public void $registerCallback(string type, string methods)

Parameters:
type
methods

$registerValidation

public void $registerValidation(string when)
Called from the high level validation helpers to register the validation in the class struct of the model.

Parameters:
when

$removeFromCache

public void $removeFromCache(string key, [string category='main'])

Parameters:
key
category

$routeVariables

public string $routeVariables()


$setDefaultValues

public any $setDefaultValues()


$setForeignKeyValues

public void $setForeignKeyValues(struct missingMethodArguments, string keys, [boolean setToNull='false'])

Parameters:
missingMethodArguments
keys
setToNull

$setObjectOrNumberToKey

public void $setObjectOrNumberToKey(struct missingMethodArguments)

Parameters:
missingMethodArguments

$simpleLock

public any $simpleLock(string execute, [struct executeArgs='[runtime expression]'], [numeric timeout='30'])

Parameters:
execute
executeArgs
timeout

$singularizeOrPluralize

public string $singularizeOrPluralize(string text, string which, [numeric count='-1'], [boolean returnCount='true'])
Called by singularize and pluralize to perform the conversion.

Parameters:
text
which
count
returnCount

$softDeleteColumn

public string $softDeleteColumn()


$softDeletion

public boolean $softDeletion()


$throw

public void $throw()


$update

public boolean $update(any parameterize)

Parameters:
parameterize

$updatePersistedProperties

public void $updatePersistedProperties()


$validate

public boolean $validate(string type)
Runs all the validation methods setup on the object and adds errors as it finds them. Returns `true` if no errors were added, `false` otherwise.

Parameters:
type

$validateConfirmationOf

public void $validateConfirmationOf()
Adds an error if the object property fail to pass the validation setup in the @validatesConfirmationOf method.


$validateExclusionOf

public void $validateExclusionOf()
Adds an error if the object property fail to pass the validation setup in the @validatesExclusionOf method.


$validateFormatOf

public void $validateFormatOf()
Adds an error if the object property fail to pass the validation setup in the @validatesFormatOf method.


$validateInclusionOf

public void $validateInclusionOf()
Adds an error if the object property fail to pass the validation setup in the @validatesInclusionOf method.


$validateLengthOf

public void $validateLengthOf()
Adds an error if the object property fail to pass the validation setup in the @validatesLengthOf method.


$validateNumericalityOf

public void $validateNumericalityOf()
Adds an error if the object property fail to pass the validation setup in the @validatesNumericalityOf method.


$validateUniquenessOf

public void $validateUniquenessOf()
Adds an error if the object property fail to pass the validation setup in the @validatesUniquenessOf method.


$validationErrorMessage

public string $validationErrorMessage(string message, string property)
Creates nicer looking error text by humanizing the property name and capitalizing it when appropriate.

Parameters:
message
property

$zip

public any $zip()


URLFor

public string URLFor([string route=''], [string controller=''], [string action=''], [any key=''], [string params=''], [string anchor=''], [boolean onlyPath='[runtime expression]'], [string host='[runtime expression]'], [string protocol='[runtime expression]'], [numeric port='[runtime expression]'])
Creates an internal URL based on supplied arguments.

Parameters:
route - Name of a route that you have configured in 'config/routes.cfm'
controller - Name of the controller to include in the URL
action - Name of the action to include in the URL
key - Key(s) to include in the URL
params - Any additional params to be set in the query string
anchor - Sets an anchor name to be appended to the path
onlyPath - If true, returns only the relative URL (no protocol, host name or port)
host - Set this to override the current host
protocol - Set this to override the current protocol
port - Set this to override the current port number

addError

public void addError(string property, string message, [string name=''])
Adds an error on a specific property.

Parameters:
property - The name of the property you want to add an error for.
message - The error message (such as "Please enter a correct name in the form field" for example).
name - A name to identify the error by (useful when you need to distinguish one error from another one set on the same object and you don't want to use the error message itself for that).

addErrorToBase

public void addErrorToBase(string message, [string name=''])
Adds an error on the object as a whole (not related to any specific property).

Parameters:
message - See documentation for @addError.
name - See documentation for @addError.

addRoute

public void addRoute(string name, string pattern, [string controller=''], [string action=''])
Adds a new route to your application.

Parameters:
name - Name for the route
pattern - The URL pattern for the route
controller - Controller to call when route matches (unless the controller name exists in the pattern)
action - Action to call when route matches (unless the action name exists in the pattern)

afterCreate

public void afterCreate([string methods=''])
Registers method(s) that should be called after a new object is created.

Parameters:
methods - See documentation for @afterNew.

afterDelete

public void afterDelete([string methods=''])
Registers method(s) that should be called after an object is deleted.

Parameters:
methods - See documentation for @afterNew.

afterFind

public void afterFind([string methods=''])
Register method(s) that should be called after an existing object has been initialized (usually done with the findByKey or findOne method).

Parameters:
methods - See documentation for @afterNew.

afterInitialization

public void afterInitialization([string methods=''])
Register method(s) that should be called after an object has been initialized.

Parameters:
methods - See documentation for @afterNew.

afterNew

public void afterNew([string methods=''])
Register method(s) that should be called after a new object has been initialized (usually done with the @new method).

Parameters:
methods - Method name or list of method names (can also be called with the `method` argument).

afterSave

public void afterSave([string methods=''])
Registers method(s) that should be called after an object is saved.

Parameters:
methods - See documentation for @afterNew.

afterUpdate

public void afterUpdate([string methods=''])
Registers method(s) that should be called after an existing object is updated.

Parameters:
methods - See documentation for @afterNew.

afterValidation

public void afterValidation([string methods=''])
Registers method(s) that should be called after an object is validated.

Parameters:
methods - See documentation for @afterNew.

afterValidationOnCreate

public void afterValidationOnCreate([string methods=''])
Registers method(s) that should be called after a new object is validated.

Parameters:
methods - See documentation for @afterNew.

afterValidationOnUpdate

public void afterValidationOnUpdate([string methods=''])
Registers method(s) that should be called after an existing object is validated.

Parameters:
methods - See documentation for @afterNew.

allChanges

public struct allChanges()
Returns a struct detailing all changes that have been made on the object but not yet saved to the database.


allErrors

public array allErrors()
Returns an array of all the errors on the object.


average

public any average(string property, [string where=''], [string include=''], [boolean distinct='[runtime expression]'])
Calculates the average value for a given property. Uses the SQL function `AVG`. If no records can be found to perform the calculation on, a blank string is returned.

Parameters:
property - Name of the property to calculate the average for.
where - An SQL fragment such as `lastName LIKE 'A%'` for example.
include - Any associations that need to be included in the query.
distinct - When `true`, `AVG` will be performed only on each unique instance of a value, regardless of how many times the value occurs.

beforeCreate

public void beforeCreate([string methods=''])
Registers method(s) that should be called before a new object is created.

Parameters:
methods - See documentation for @afterNew.

beforeDelete

public void beforeDelete([string methods=''])
Registers method(s) that should be called before an object is deleted.

Parameters:
methods - See documentation for @afterNew.

beforeSave

public void beforeSave([string methods=''])
Registers method(s) that should be called before an object is saved.

Parameters:
methods - See documentation for @afterNew.

beforeUpdate

public void beforeUpdate([string methods=''])
Registers method(s) that should be called before an existing object is updated.

Parameters:
methods - See documentation for @afterNew.

beforeValidation

public void beforeValidation([string methods=''])
Register method(s) that should be called before an object is validated.

Parameters:
methods - See documentation for @afterNew.

beforeValidationOnCreate

public void beforeValidationOnCreate([string methods=''])
Registers method(s) that should be called before a new object is validated.

Parameters:
methods - See documentation for @afterNew.

beforeValidationOnUpdate

public void beforeValidationOnUpdate([string methods=''])
Registers method(s) that should be called before an existing object is validated.

Parameters:
methods - See documentation for @afterNew.

belongsTo

public void belongsTo(string name, [string class=''], [string foreignKey=''], [string joinType='[runtime expression]'])
Sets up a `belongsTo` association between this model and the specified one.

Parameters:
name - Gives the association a name that you refer to when working with the association (in the `include` argument to @findAll to name one example).
class - Name of associated class (usually not needed if you follow the Wheels conventions since the model name will be deduced from the `name` argument).
foreignKey - Foreign key property name (usually not needed if you follow the Wheels conventions since the foreign key name will be deduced from the `name` argument).
joinType - Use to set the join type when joining associated tables, possible values are `inner` (for `INNER JOIN`) and `outer` (for `LEFT OUTER JOIN`).

capitalize

public string capitalize(string text)
Returns the text with the first character converted to uppercase.

Parameters:
text - Text to capitalize

changedFrom

public string changedFrom(string property)
Returns the previous value of a property that has changed. Returns an empty string if no previous value exists. Wheels will keep a note of the previous property value until the object is saved to the database.

Parameters:
property - Name of property to get the previous value for.

changedProperties

public string changedProperties()
Returns a list of the object properties that have been changed but not yet saved to the database.


clearErrors

public void clearErrors([string property=''], [string name=''])
Clears out all errors set on the object or only the ones set for a specific property or name.

Parameters:
property - Specify a property name here if you want to clear all errors set on that property.
name - Specify an error name here if you want to clear all errors set with that error name.

columnNames

public string columnNames()
Returns a list of column names in the table mapped to this model. The list is ordered according to the columns ordinal position in the database table.


count

public numeric count([string where=''], [string include=''])
Returns the number of rows that match the arguments (or all rows if no arguments are passed in). Uses the SQL function `COUNT`. If no records can be found to perform the calculation on, `0` is returned.

Parameters:
where - See documentation for @average.
include - See documentation for @average.

create

public any create([struct properties='[runtime expression]'], [boolean defaults='[runtime expression]'], [any parameterize='[runtime expression]'])
Creates a new object, saves it to the database (if the validation permits it) and returns it. If the validation fails, the unsaved object (with errors added to it) is still returned. Property names and values can be passed in either using named arguments or as a struct to the `properties` argument.

Parameters:
properties - See documentation for @new.
defaults - See documentation for @save.
parameterize - See documentation for @save.

dataSource

public void dataSource(string datasource, [string username=''], [string password=''])
Use this method to override the data source connection information for this model.

Parameters:
datasource - The data source name to connect to.
username - The username for the data source.
password - The password for the data source.

delete

public boolean delete([any parameterize='[runtime expression]'])
Deletes the object, which means the row is deleted from the database (unless prevented by a `beforeDelete` callback). Returns `true` on successful deletion of the row, `false` otherwise.

Parameters:
parameterize - See documentation for @findAll.

deleteAll

public numeric deleteAll([string where=''], [string include=''], [any parameterize='[runtime expression]'], [boolean instantiate='[runtime expression]'], [boolean $softDeleteCheck='true'])
Deletes all records that match the where argument. By default objects will not be instantiated and therefore callbacks and validations are not invoked. You can change this behavior by passing in `instantiate=true`. Returns the number of records that were deleted.

Parameters:
where - See documentation for @findAll.
include - See documentation for @findAll.
parameterize - See documentation for @findAll.
instantiate - See documentation for @updateAll.
$softDeleteCheck

deleteByKey

public boolean deleteByKey(any key)
Finds the record with the supplied key and deletes it. Returns `true` on successful deletion of the row, `false` otherwise.

Parameters:
key - See documentation for @findByKey.

deleteOne

public boolean deleteOne([string where=''], [string order=''])
Gets an object based on conditions and deletes it.

Parameters:
where - See documentation for @findAll.
order - See documentation for @findAll.

deobfuscateParam

public string deobfuscateParam(string param)
Deobfuscates a value.

Parameters:
param - Value to deobfuscate

errorCount

public numeric errorCount([string property=''], [string name=''])
Returns the number of errors this object has associated with it. Specify `property` or `name` if you wish to count only specific errors.

Parameters:
property - Specify a property name here if you want to count only errors set on a specific property.
name - Specify an error name here if you want to count only errors set with a specific error name.

errorsOn

public array errorsOn(string property, [string name=''])
Returns an array of all errors associated with the supplied property (and error name when passed in).

Parameters:
property - Specify the property name to return errors for here.
name - If you want to return only errors on the above property set with a specific error name you can specify it here.

errorsOnBase

public array errorsOnBase([string name=''])
Returns an array of all errors associated with the object as a whole (not related to any specific property).

Parameters:
name - Specify an error name here to only return errors for that error name.

exists

public boolean exists([any key=''], [string where=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'])
Checks if a record exists in the table. You can pass in either a primary key value to the `key` argument or a string to the `where` argument.

Parameters:
key - See documentation for @findByKey.
where - See documentation for @findAll.
reload - See documentation for @findAll.
parameterize - See documentation for @findAll.

findAll

public any findAll([string where=''], [string order='[runtime expression]'], [string select=''], [boolean distinct='false'], [string include=''], [numeric maxRows='-1'], [numeric page='0'], [numeric perPage='[runtime expression]'], [numeric count='0'], [string handle='query'], [any cache=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'], [string returnAs='[runtime expression]'], [boolean returnIncluded='[runtime expression]'], [numeric $limit='0'], [numeric $offset='0'], [boolean $softDeleteCheck='true'])
Returns records from the database table mapped to this model according to the arguments passed in (use the `where` argument to decide which records to get, use the `order` argument to set in what order those records should be returned and so on). The records will be returned as either a `cfquery` result set or an array of objects (depending on what the `returnAs` argument is set to). Instead of using the `where` argument you can create cleaner code by making use of a concept called dynamic finders.

Parameters:
where - This argument maps to the `WHERE` clause of the query. The following operators are supported: `=`, `<>`, `<`, `<=`, `>`, `>=`, `LIKE`, `AND`, and `OR` (note that the key words have to be written in upper case). You can also use parentheses to group statements. You do not have to specify the table name(s), Wheels will do that for you.
order - This argument maps to the `ORDER BY` clause of the query. You do not have to specify the table name(s), Wheels will do that for you.
select - This argument determines how the `SELECT` clause for the query used to return data will look. You can pass in a list of the properties (which maps to columns) that you want returned from your table(s). If you don't set this argument at all, Wheels will select all properties from your table(s). If you specify a table name (e.g. `users.email`) or alias a column (e.g. `fn AS firstName`) in the list then the entire list will be passed through unchanged and used in the `SELECT` clause of the query. If not, Wheels will prepend the table name and resolve any naming collisions (which could happen when using the `include` argument) automatically for you. The naming collisions are resolved by prepending the model name to the property name so `users.firstName` could become `userFirstName` for example.
distinct - Boolean value to decide whether to add the `DISTINCT` keyword to your `SELECT` clause. Wheels will, when necessary, add this automatically (when using pagination and a `hasMany` association is used in the `include` argument to name one example).
include - Associations that should be included in the query using `INNER` or `LEFT OUTER` joins (which join type that is used depends on how the association has been set up in your model). If all included associations are set on the current model you can specify them in a list, e.g. `department,addresses,emails`. You can build more complex `include` strings by using parentheses when the association is set on an included model, like `album(artist(genre))` for example.
maxRows - Maximum number of records to retrieve. Passed on to the `maxRows` `cfquery` attribute. The default `-1` means that all records will be retrieved.
page - If you want to paginate records (i.e. get records 11-20 for example) you can do so by specifying a page number here. For example, getting records 11-20 would be page number 2 when `perPage` is kept at the default setting (10 records per page). The default, `0`, means that records won't be paginated and that the `perPage`, `count` and `handle` arguments will be ignored.
perPage - When using pagination you can specify how many records you want to fetch per page here. This argument is only used when the `page` argument has been passed in.
count - When using pagination and you know in advance how many records you want to paginate through you can pass in that value here. Doing so will prevent Wheels from running a `COUNT` query to get this value. This argument is only used when the `page` argument has been passed in.
handle - Handle to use for the query in pagination. This is useful when you're paginating multiple queries and need to reference them in the @paginationLinks function for example. This argument is only used when the `page` argument has been passed in.
cache - Accepts a boolean or numeric value. If you want to cache the query you can do so by specifying the number of minutes you want to cache the query for here. If you set it to `true` the default cache time will be used (60 minutes).
reload - Set to `true` to force Wheels to query the database even though an identical query has been run in the same request (the default in Wheels is to get the second query from the cache).
parameterize - Accepts a boolean value or a string. Set to `true` to use `cfqueryparam` on all columns or pass in a list of property names to use `cfqueryparam` on those only.
returnAs - Set this to `objects` to return an array of objects instead of a query result set which is the default return type.
returnIncluded - When `returnAs` is set to `objects` you can set this argument to `false` to prevent returning objects fetched from associations specified in the `include` argument. This is useful when you only need to include associations for use in the `WHERE` clause only and want to avoid the performance hit that comes with object creation.
$limit
$offset
$softDeleteCheck

findByKey

public any findByKey(any key, [string select=''], [string include=''], [any cache=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'], [string returnAs='[runtime expression]'], [boolean $softDeleteCheck='true'])
Fetches the requested record and returns it as an object. Returns `false` if no record is found. You can override this behavior to return a `cfquery` result set instead, similar to what's described in the documentation for @findOne.

Parameters:
key - Primary key value(s) of the record to fetch. Separate with comma if passing in multiple primary key values. Accepts a string, list or a numeric value.
select - See documentation for @findAll.
include - See documentation for @findAll.
cache - See documentation for @findAll.
reload - See documentation for @findAll.
parameterize - See documentation for @findAll.
returnAs - Can be set to either `object` or `query`. See documentation for @findAll for more info.
$softDeleteCheck

findOne

public any findOne([string where=''], [string order=''], [string select=''], [string include=''], [any cache=''], [boolean reload='[runtime expression]'], [any parameterize='[runtime expression]'], [string returnAs='[runtime expression]'], [boolean $softDeleteCheck='true'])
Fetches the first record found based on the `WHERE` and `ORDER BY` clauses. With the default settings (i.e. the `returnAs` argument set to `object`) a model object will be returned if the record is found and the boolean value `false` if not. Instead of using the `where` argument you can create cleaner code by making use of a concept called dynamic finders.

Parameters:
where - See documentation for @findAll.
order - See documentation for @findAll.
select - See documentation for @findAll.
include - See documentation for @findAll.
cache - See documentation for @findAll.
reload - See documentation for @findAll.
parameterize - See documentation for @findAll.
returnAs - Can be set to either `object` or `query`. See documentation for @findAll for more info.
$softDeleteCheck

get

public any get(string name, [string functionName=''])
Returns the current setting for the supplied variable name.

Parameters:
name - Variable name to get setting for
functionName - Function name to get setting for

hasChanged

public boolean hasChanged([string property=''])
Returns `true` if the specified object property (or any if none was passed in) have been changed but not yet saved to the database. Will also return `true` if the object is new and no record for it exists in the database.

Parameters:
property - Name of property to check for change.

hasErrors

public boolean hasErrors([string property=''], [string name=''])
Returns `true` if the object has any errors. You can also limit to only check a specific property and name for errors.

Parameters:
property - Name of the property to check if there are any errors set on.
name - Error name to check if there are any errors set with.

hasMany

public void hasMany(string name, [string class=''], [string foreignKey=''], [string joinType='[runtime expression]'], [string shortcut=''], [string through='[runtime expression]'])
Sets up a `hasMany` association between this model and the specified one.

Parameters:
name - See documentation for @belongsTo.
class - See documentation for @belongsTo.
foreignKey - See documentation for @belongsTo.
joinType - See documentation for @belongsTo.
shortcut - Set this argument to create an additional dynamic method that gets the objects for a many-to-many association.
through - Set this argument if you need to override the Wheels convention when using the `shortcut` argument.

hasOne

public void hasOne(string name, [string class=''], [string foreignKey=''], [string joinType='[runtime expression]'])
Sets up a `hasOne` association between this model and the specified one.

Parameters:
name - See documentation for @belongsTo.
class - See documentation for @belongsTo.
foreignKey - See documentation for @belongsTo.
joinType - See documentation for @belongsTo.

humanize

public string humanize(string text)
Returns readable text by capitalizing, converting camel casing to multiple words.

Parameters:
text - Text to humanize

isNew

public boolean isNew()
Returns `true` if this object hasn't been saved yet (in other words no record exists in the database yet). Returns `false` if a record exists.


key

public string key([boolean $persisted='false'])
Returns the value of the primary key for the object. If you have a single primary key named `id` then `someObject.key()` is functionally equivalent to `someObject.id`. This method is more useful when you do dynamic programming and don't know the name of the primary key or when you use composite keys (in which case it's convenient to use this method to get a list of both key values returned).

Parameters:
$persisted

maximum

public any maximum(string property, [string where=''], [string include=''])
Calculates the maximum value for a given property. Uses the SQL function `MAX`. If no records can be found to perform the calculation on, a blank string is returned.

Parameters:
property - Name of the property to get the highest value for (has to be a property of a numeric data type).
where - See documentation for @average.
include - See documentation for @average.

minimum

public any minimum(string property, [string where=''], [string include=''])
Calculates the minimum value for a given property. Uses the SQL function `MIN`. If no records can be found to perform the calculation on, a blank string is returned.

Parameters:
property - Name of the property to get the lowest value for (has to be a property of a numeric data type).
where - See documentation for @average.
include - See documentation for @average.

model

public any model(string name)
Returns a reference to the requested model so that class level methods can be called on it.

Parameters:
name - Name of the model (class name) to get a reference to

new

public any new([struct properties='[runtime expression]'], [boolean defaults='[runtime expression]'])
Creates a new object based on supplied properties and returns it. The object is not saved to the database, it only exists in memory. Property names and values can be passed in either using named arguments or as a struct to the `properties` argument.

Parameters:
properties - The properties you want to set on the object (can also be passed in as named arguments instead).
defaults - See documentation for @save.

obfuscateParam

public string obfuscateParam(any param)
Obfuscates a value.

Parameters:
param - Value to obfuscate

onMissingMethod

public any onMissingMethod(string missingMethodName, struct missingMethodArguments)
This method handles dynamic finders, property and association methods. It is not part of the public API.

Parameters:
missingMethodName
missingMethodArguments

pluginNames

public string pluginNames()
Returns a list of all installed plugins.


pluralize

public string pluralize(string word, [numeric count='-1'], [boolean returnCount='true'])
Returns the plural form of the passed in word.

Parameters:
word - The word to pluralize
count - Pluralization will occur when this value is not 1
returnCount - Will return the count prepended to the pluralization when true and count is not -1

primaryKey

public string primaryKey()
Returns the name of the primary key for this model's table. This is determined through database introspection. If composite primary keys have been used they will both be returned in a list.


properties

public struct properties()
Returns a structure of all the properties with their names as keys and the values of the property as values.


property

public void property(string name, [string column=''], [string sql=''])
Use this method to map an object property to either a table column with a different name than the property or to a specific SQL function. You only need to use this method when you want to override the default mapping that Wheels performs.

Parameters:
name - The name that you want to use for the column or SQL function result in the CFML code.
column - The name of the column in the database table to map the property to.
sql - An SQL function to use to calculate the property value.

propertyNames

public string propertyNames()
Returns a list of property names (ordered by their respective column's ordinal position in the database table).


reload

public void reload()
Reloads the property values of this object from the database.


save

public boolean save([any parameterize='[runtime expression]'], [boolean defaults='[runtime expression]'])
Saves the object if it passes validation and callbacks. Returns `true` if the object was saved successfully to the database, `false` if not.

Parameters:
parameterize - See documentation for @findAll.
defaults - Whether or not to set default values for properties.

set

public void set()
Use to configure a global setting.


setProperties

public void setProperties([struct properties='[runtime expression]'])
Allows you to set all the properties at once by passing in a structure with keys matching the property names.

Parameters:
properties

singularize

public string singularize(string word)
Returns the singular form of the passed in word.

Parameters:
word - String to singularize

sum

public any sum(string property, [string where=''], [string include=''], [boolean distinct='[runtime expression]'])
Calculates the sum of values for a given property. Uses the SQL function `SUM`. If no records can be found to perform the calculation on, `0` is returned.

Parameters:
property - Name of the property to get the sum for (has to be a property of a numeric data type).
where - See documentation for @average.
include - See documentation for @average.
distinct - When `true`, `SUM` returns the sum of unique values only.

table

public void table(string name)
Use this method to tell Wheels what database table to connect to for this model. You only need to use this method when your table naming does not follow the standard Wheels convention of a singular object name mapping to a plural table name.

Parameters:
name - Name of the table to map this model to.

tableName

public string tableName()
Returns the name of the database table that this model is mapped to.


update

public boolean update([struct properties='[runtime expression]'], [any parameterize='[runtime expression]'])
Updates the object with the supplied properties and saves it to the database. Returns `true` if the object was saved successfully to the database and `false` otherwise.

Parameters:
properties - See documentation for @new.
parameterize - See documentation for @findAll.

updateAll

public numeric updateAll([string where=''], [string include=''], [struct properties='[runtime expression]'], [any parameterize='[runtime expression]'], [boolean instantiate='[runtime expression]'], [boolean $softDeleteCheck='true'])
Updates all properties for the records that match the where argument. Property names and values can be passed in either using named arguments or as a struct to the `properties` argument. By default objects will not be instantiated and therefore callbacks and validations are not invoked. You can change this behavior by passing in `instantiate=true`. This method returns the number of records that were updated.

Parameters:
where - See documentation for @findAll.
include - See documentation for @findAll.
properties - See documentation for @new.
parameterize - See documentation for @findAll.
instantiate - Whether or not to instantiate the object(s) first. When objects are not instantiated any callbacks and validations set on them will be skipped.
$softDeleteCheck

updateByKey

public boolean updateByKey(any key, [struct properties='[runtime expression]'])
Finds the object with the supplied key and saves it (if validation permits it) with the supplied properties and/or named arguments. Property names and values can be passed in either using named arguments or as a struct to the `properties` argument. Returns `true` if the object was found and updated successfully, `false` otherwise.

Parameters:
key - See documentation for @findByKey.
properties - See documentation for @new.

updateOne

public boolean updateOne([string where=''], [string order=''], [struct properties='[runtime expression]'])
Gets an object based on the arguments used and updates it with the supplied properties. Returns `true` if an object was found and updated successfully, `false` otherwise.

Parameters:
where - See documentation for @findAll.
order - See documentation for @findAll.
properties - See documentation for @new.

valid

public boolean valid()
Runs the validation on the object and returns `true` if it passes it. Wheels will run the validation process automatically whenever an object is saved to the database but sometimes it's useful to be able to run this method to see if the object is valid without saving it to the database.


validate

public void validate([string methods=''], [string if=''], [string unless=''])
Registers method(s) that should be called to validate objects before they are saved.

Parameters:
methods - Method name or list of method names to call (can also be called with the `method` argument).
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validateOnCreate

public void validateOnCreate([string methods=''], [string if=''], [string unless=''])
Registers method(s) that should be called to validate new objects before they are inserted.

Parameters:
methods - See documentation for @validate.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validateOnUpdate

public void validateOnUpdate([string methods=''], [string if=''], [string unless=''])
Registers method(s) that should be called to validate existing objects before they are updated.

Parameters:
methods - See documentation for @validate.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesConfirmationOf

public void validatesConfirmationOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [string if=''], [string unless=''])
Validates that the value of the specified property also has an identical confirmation value (common when having a user type in their email address, choosing a password etc). The confirmation value only exists temporarily and never gets saved to the database. By convention the confirmation property has to be named the same as the property with "Confirmation" appended at the end. Using the password example, to confirm our `password` property we would create a property called `passwordConfirmation`.

Parameters:
properties - Name of property or list of property names to validate against (can also be called with the `property` argument).
message - Supply a custom error message here to override the built-in one.
when - Pass in `onCreate` or `onUpdate` to limit when this validation occurs (by default validation will occur on both create and update, i.e. `onSave`).
if - String expression to be evaluated that decides if validation will be run (if the expression returns `true` validation will run).
unless - String expression to be evaluated that decides if validation will be run (if the expression returns `false` validation will run).

validatesExclusionOf

public void validatesExclusionOf([string properties=''], string list, [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string if=''], [string unless=''])
Validates that the value of the specified property does not exist in the supplied list.

Parameters:
properties - See documentation for @validatesConfirmationOf.
list - Single value or list of values that should not be allowed.
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
allowBlank - If set to `true`, validation will be skipped if the property value is an empty string or doesn't exist at all.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesFormatOf

public void validatesFormatOf([string properties=''], [string regEx=''], [string type=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string if=''], [string unless=''])
Validates that the value of the specified property is formatted correctly by matching it against a regular expression using the `regEx` argument and/or against a built-in CFML validation type (`creditcard`, `date`, `email` etc) using the `type` argument.

Parameters:
properties - See documentation for @validatesConfirmationOf.
regEx - Regular expression to verify against.
type - One of the following types to verify against: `creditcard`, `date`, `email`, `eurodate`, `guid`, `social_security_number`, `ssn`, `telephone`, `time`, `URL`, `USdate`, `UUID`, `variableName`, `zipcode` (will be passed through to CFML's `isValid` function).
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
allowBlank - See documentation for @validatesExclusionOf.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesInclusionOf

public void validatesInclusionOf([string properties=''], string list, [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string if=''], [string unless=''])
Validates that the value of the specified property exists in the supplied list.

Parameters:
properties - See documentation for @validatesConfirmationOf.
list - List of allowed values.
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
allowBlank - See documentation for @validatesExclusionOf.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesLengthOf

public void validatesLengthOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [numeric exactly='[runtime expression]'], [numeric maximum='[runtime expression]'], [numeric minimum='[runtime expression]'], [string within='[runtime expression]'], [string if=''], [string unless=''])
Validates that the value of the specified property matches the length requirements supplied. Use the `exactly`, `maximum`, `minimum` and `within` arguments to specify the length requirements.

Parameters:
properties - See documentation for @validatesConfirmationOf.
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
allowBlank - See documentation for @validatesExclusionOf.
exactly - The exact length that the property value has to be.
maximum - The maximum length that the property value has to be.
minimum - The minimum length that the property value has to be.
within - A list of two values (minimum and maximum) that the length of the property value has to fall within.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesNumericalityOf

public void validatesNumericalityOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [boolean onlyInteger='[runtime expression]'], [string if=''], [string unless=''])
Validates that the value of the specified property is numeric.

Parameters:
properties - See documentation for @validatesConfirmationOf.
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
allowBlank - See documentation for @validatesExclusionOf.
onlyInteger - Specifies whether the property value has to be an integer.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesPresenceOf

public void validatesPresenceOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [string if=''], [string unless=''])
Validates that the specified property exists and that its value is not blank.

Parameters:
properties - See documentation for @validatesConfirmationOf.
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

validatesUniquenessOf

public void validatesUniquenessOf([string properties=''], [string message='[runtime expression]'], [string when='onSave'], [boolean allowBlank='[runtime expression]'], [string scope=''], [string if=''], [string unless=''])
Validates that the value of the specified property is unique in the database table. Useful for ensuring that two users can't sign up to a website with identical screen names for example. When a new record is created a check is made to make sure that no record already exists in the database with the given value for the specified property. When the record is updated the same check is made but disregarding the record itself.

Parameters:
properties - See documentation for @validatesConfirmationOf.
message - See documentation for @validatesConfirmationOf.
when - See documentation for @validatesConfirmationOf.
allowBlank - See documentation for @validatesExclusionOf.
scope - One or more properties by which to limit the scope of the uniqueness constraint.
if - See documentation for @validatesConfirmationOf.
unless - See documentation for @validatesConfirmationOf.

ColdFusion On Wheels 1.0.5