Last updated 5 years ago
Returns the key (id field) of a given entity, either simple or composite keys.
If the key is a simple pk then it will return a string, if it is a composite key then it returns an array.
If the key cannot be identified then a blank string is returned.
This function returns any
var pkField = ormService.getKey( "User" );
Key
Type
Required
Default
Description
entity
string
Yes
---
The entity name or entity object