MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / getIdOf

Method getIdOf

packages/repository/src/model.ts:454–461  ·  view source on GitHub ↗

* Get the identity value for a given entity instance or entity data object. * * @param entityOrData - The data object for which to determine the identity * value.

(entityOrData: AnyObject)

Source from the content-addressed store, hash-verified

452 * value.
453 */
454 static getIdOf(entityOrData: AnyObject): any {
455 if (typeof entityOrData.getId === 'function') {
456 return entityOrData.getId();
457 }
458
459 const idName = this.getIdProperties()[0];
460 return entityOrData[idName];
461 }
462
463 /**
464 * Get the identity value. If the identity is a composite key, returns

Callers 6

saveMethod · 0.80
updateMethod · 0.80
deleteMethod · 0.80
saveMethod · 0.80
model.unit.tsFile · 0.80
saveMethod · 0.80

Implementers 1

SequelizeModelextensions/sequelize/src/sequelize/seq

Calls 2

getIdPropertiesMethod · 0.95
getIdMethod · 0.45

Tested by

no test coverage detected