Add getById to domain template

`Map<Id, ${SObject_API_Name}> getById()`

Signed-off-by: WimVelzeboer <wimvelzeboer@protonmail.com>
This commit is contained in:
WimVelzeboer
2022-02-24 10:23:38 +00:00
parent 969b0fbba7
commit d811e53b84
2 changed files with 6 additions and 0 deletions
@@ -22,6 +22,11 @@ public inherited sharing class ${NAME}
return (List<${SObject_API_Name}>) getRecords();
}
public Map<Id, ${SObject_API_Name}> getById()
{
return new Map<Id, ${SObject_API_Name}>(get${NAME}());
}
public I${NAME} selectById(Set<Id> ids)
{
return new ${NAME}(getRecords(ids));
@@ -2,5 +2,6 @@ public interface I${NAME}
extends fflib_ISObjects
{
List<${SObject_API_Name}> get${NAME}();
Map<Id, ${SObject_API_Name}> getById();
I${NAME} selectById(Set<Id> ids);
}