Miscellaneous
setPrimaryKeys()
Signature
Section titled “Signature”setPrimaryKeys() — returns any
Description
Section titled “Description”Alias for setPrimaryKey(). Use this for better readability when you’re setting multiple properties as the primary key.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
property | string | yes | — | Property (or list of properties) to set as the primary key. |
Examples
Section titled “Examples”setPrimaryKeys(property) <!--- In `models/Subscription.cfc`, define the primary key as composite of the columns `customerId` and `publicationId` --->
<cffunction name="init">
<cfset setPrimaryKeys("customerId,publicationId")>
</cffunction>