Skip to content

Commit 7f6b6d8

Browse files
committed
Merge pull request apex-enterprise-patterns#69 from jondavis9898/issue56-add-beforevalidation
Issue apex-enterprise-patterns#56 - virtualize handle methods
2 parents 75d0e27 + 9df203a commit 7f6b6d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fflib/src/classes/fflib_SObjectDomain.cls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ public virtual with sharing class fflib_SObjectDomain
155155
/**
156156
* Base handler for the Apex Trigger event Before Update, calls the onBeforeUpdate method
157157
**/
158-
public void handleBeforeUpdate(Map<Id,SObject> existingRecords)
158+
public virtual void handleBeforeUpdate(Map<Id,SObject> existingRecords)
159159
{
160160
onBeforeUpdate(existingRecords);
161161
}
162162

163163
/**
164164
* Base handler for the Apex Trigger event Before Delete, calls the onBeforeDelete method
165165
**/
166-
public void handleBeforeDelete()
166+
public virtual void handleBeforeDelete()
167167
{
168168
onBeforeDelete();
169169
}
@@ -173,7 +173,7 @@ public virtual with sharing class fflib_SObjectDomain
173173
*
174174
* @throws DomainException if the current user context is not able to create records
175175
**/
176-
public void handleAfterInsert()
176+
public virtual void handleAfterInsert()
177177
{
178178
if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isCreateable())
179179
throw new DomainException('Permission to create an ' + SObjectDescribe.getName() + ' denied.');
@@ -187,7 +187,7 @@ public virtual with sharing class fflib_SObjectDomain
187187
*
188188
* @throws DomainException if the current user context is not able to update records
189189
**/
190-
public void handleAfterUpdate(Map<Id,SObject> existingRecords)
190+
public virtual void handleAfterUpdate(Map<Id,SObject> existingRecords)
191191
{
192192
if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isUpdateable())
193193
throw new DomainException('Permission to udpate an ' + SObjectDescribe.getName() + ' denied.');
@@ -203,7 +203,7 @@ public virtual with sharing class fflib_SObjectDomain
203203
*
204204
* @throws DomainException if the current user context is not able to delete records
205205
**/
206-
public void handleAfterDelete()
206+
public virtual void handleAfterDelete()
207207
{
208208
if(Configuration.EnforcingTriggerCRUDSecurity && !SObjectDescribe.isDeletable())
209209
throw new DomainException('Permission to delete an ' + SObjectDescribe.getName() + ' denied.');

0 commit comments

Comments
 (0)