Add getById to domain template
`Map<Id, ${SObject_API_Name}> getById()`
Signed-off-by: WimVelzeboer <wimvelzeboer@protonmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user