Lucee Function Reference
entityloadbypk()
Loads and returns an array of objects for given primary key.
Beispiel
entityloadbypk(string name,any id,[boolean unique]):any
Argumente
Die Argumente für diese Funktion sind fest vorgegeben. Ausser den nachfolgenden Argumenten dürfen keine weiteren verwendet werden.
Name | Typ | Required | Beschreibung |
---|---|---|---|
name | string | Yes | Name of the entity to be loaded. |
id | any | Yes | The primary key value of the entity that must be loaded |
unique | boolean | No |
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. |