-
-
Notifications
You must be signed in to change notification settings - Fork 17
getAll
Annette Liskey edited this page Aug 19, 2019
·
4 revisions
Retrieve all the instances from the passed-in entity name using an optional ID argument. Retrieve all instances if there is no ID specified. The ID argument can be a single ID, a list of IDs or an array of IDs. If the ID is not found or returns null, the array position will have an empty string in it in the specified order
###Returns
- This function returns array of entities found
###Arguments
Key | Type | Required | Default | Description |
---|---|---|---|---|
entityName | string | Yes | --- | |
id | any | No | --- | |
sortOrder | string | false | --- | The sort ordering of the array |
###Examples
// Get all user entities
users = ORMService.getAll(entityName="User");
// Get all user entities sorted by email descending
users = ORMService.getAll(entityName="User", sortOrder="email desc");
// Get all the following users by id's
users = ORMService.getAll("User","1,2,3");
// Get all the following users by id's as array
users = ORMService.getAll("User",[1,2,3,4,5]);