entityLoadByPK

Loads and returns an array of objects for given primary key.
Use this function to avoid specifying the required boolean parameter in EntityLoad().

entityLoadByPK(entity, id) → returns any

entityLoadByPK Argument Reference

entity string
Required

Name of the entity to be loaded.

id string
Required

ID of the entity to be loaded.

unique boolean

Lucee 4.5+ Specify whether you expect multiple or just one record.
If set to true, the entity is returned.
If set to false an array is returned to support multiple entities.
If set to true but multiple entities would be returned an error will be thrown.

Compatibility

Lucee:

Allows the optional unique parameter.

Examples sample code invoking the entityLoadByPK function

user = entityLoadByPK("User", userID);

Fork me on GitHub