Skip to content

Commit 3d1cfeb

Browse files
John M. DanielJohn M. Daniel
authored andcommitted
corrected structure of Accounts domain to include inner Constructor class
1 parent 8746dcb commit 3d1cfeb

File tree

1 file changed

+10
-2
lines changed
  • sfdx-source/apex-common-samplecode/main/classes/domains

1 file changed

+10
-2
lines changed

sfdx-source/apex-common-samplecode/main/classes/domains/Accounts.cls

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,20 @@ public with sharing class Accounts extends fflib_SObjectDomain
4242
super(sObjectList);
4343
}
4444

45-
public void updateOpportunityActivity(fflib_SObjectUnitOfWork uow)
45+
public void updateOpportunityActivity(fflib_ISObjectUnitOfWork uow)
4646
{
47-
for(Account account : (List<Account>) Records)
47+
for(Account account : (List<Account>) this.records)
4848
{
4949
account.Description = 'Last Opportunity Raised ' + System.today();
5050
uow.registerDirty(account);
5151
}
5252
}
53+
54+
public class Constructor implements fflib_SObjectDomain.IConstructable
55+
{
56+
public fflib_SObjectDomain construct(List<SObject> sObjectList)
57+
{
58+
return new Accounts(sObjectList);
59+
}
60+
}
5361
}

0 commit comments

Comments
 (0)