includedInObject()
Description
Used as a shortcut to check if the specified IDs are a part of the main form object. This method should only be used for hasMany associations.
Function Syntax
includedInObject(objectName, association, keys)
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
objectName |
string |
Yes | |
Name of the variable containing the parent object to represent with this form field. |
association |
string |
Yes | |
Name of the association set in the parent object to represent with this form field. |
keys |
string |
Yes | |
Primary keys associated with this form field. |
Examples
<!--- Check to see if the customer is subscribed to the Swimsuit Edition. Note that the order of the `keys` argument should match the order of the `customerid` and `publicationid` columns in the `subscriptions` join table --->
<cfif not includedInObject(objectName="customer", association="subscriptions", keys="#customer.key()#,#swimsuitEdition.id#")>
<cfset assignSalesman(customer)>
</cfif>
