Loads and returns an array of entities of the specified entityname.
EntityLoad (entityname, filtercriteria [,unique]
EntityLoad(entityname, filtercriteria, sortorder [, options])
Lucee Function Reference
Function ENTITYLOAD
Example
entityload(string name,[any idOrFilter,[any uniqueOrOrder,[any options]]]):any
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
Name | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the entity to be loaded. |
idOrFilter | any | No |
The primary key value of the entity that must be loaded or Key-value pair (Struct) of property names and values. If there are more than one key-value pair, then the AND operator is used.If specified, loads and returns an array of entities of the specified entity name that matches the filtercriteria. |
uniqueOrOrder | any | No |
when the second argument is a id then this argument defines the boolean "unique" otherwise it defines the order. If unique is set to true, then the entity is returned. If you are sure that only one record exists that matches this filtercriteria, then you can specify unique=true, so that a single entity is returned instead of an array. If you set unique=true and multiple records are returned, then an exception occurs. String used to specify the sortorder of the entities that are returned.If specified, loads and returns an array of entities that satisfy the filtercriteria sorted as specified by the sortorder. |
options | any | No |
The following options to customize the output (only used when second argument is "id"): |