Miscellaneous
hasProperty()
Signature
Section titled “Signature”hasProperty() — returns any
Description
Section titled “Description”Returns true if the specified property name exists on the model.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | yes | — | Name of property to inspect. |
Examples
Section titled “Examples”hasProperty(property) <!--- Get an object, set a value and then see if the property exists --->
<cfset employee = model("employee").new()>
<cfset employee.firstName = "dude">
<cfset employee.hasProperty("firstName")><!--- returns true --->
<!--- This is also a dynamic method that you could do --->
<cfset employee.hasFirstName()>