From 0b6d11594d15f89a2a2092b70c8ce270661f8f40 Mon Sep 17 00:00:00 2001 From: Robert Baillie Date: Tue, 22 Mar 2022 14:18:34 +0000 Subject: [PATCH] Added docs and clarified name for DmlRecord method to get child sobjects --- .../default/classes/services/dml/DmlRecord.cls | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/framework/default/ortoo-core/default/classes/services/dml/DmlRecord.cls b/framework/default/ortoo-core/default/classes/services/dml/DmlRecord.cls index 55fdf0c5902..d5ff11073df 100644 --- a/framework/default/ortoo-core/default/classes/services/dml/DmlRecord.cls +++ b/framework/default/ortoo-core/default/classes/services/dml/DmlRecord.cls @@ -159,12 +159,23 @@ public virtual inherited sharing class DmlRecord @testVisible protected DmlDefiner getChildDefiner( String childRecordType ) { + Contract.requires( childRecordType != null, 'getChildDefiner called with a null childRecordType' ); + checkTypeIsValid( childRecordType ); return this.childRecordsByType.get( childRecordType ); } - protected List getChildren( String childRecordType ) + + /** + * Returns the Sobjects that represent the child records for the given relationship + * + * @param String The 'Type' that will identify the child relationship for which to return + * @return List The List representing the child records currently on this DmlRecord + */ + protected List getChildSobjects( String childRecordType ) { + Contract.requires( childRecordType != null, 'getChildSobjects called with a null childRecordType' ); + return getChildDefiner( childRecordType ).getSobjects(); }