entityLoad

Loads and returns an array of entities of the specified entityname or an entity if unique=true or if a primary key id is passed in to filterCriteria.

entityLoad(entityName [, filterCriteria] [, unique])
entityLoad(entityName [, filterCriteria] [, sortOrder] [, options]) → returns array|object

entityLoad Argument Reference

entityName
Required

Name of CFC / Entity

filterCriteria

A struct of key value pairs, or a primary key value

unique

When true a single entity is returned, otherwise an array

sortOrder

Column name and direction list, eg: LastName ASC, FirstName ASC

options

A struct with possible keys: ignorecase, sortorder, offset, maxresults, cacheable, cachename, timeout

Examples sample code invoking the entityLoad function


Load by PK

Loads an entity by primary key value

entityLoad("Employee", url.employee_id)

Expected Result: An Employee CFC Instance


Get multiple entities

Returns an array of Employee instances with last name Smith

entityLoad("Employee", {LastName="Smith"})

Expected Result: array


Fork me on GitHub