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(); }