I want to create a trigger that will only pass its trigger context to a static method in a handler class I have created where all the business logic resides. I want to pass the trigger context directly to my handler as shown in the case below but it seems that it is not possible to reference the trigger context outside of a trigger.
//For the trigger
trigger myTrigger on sObject (after insert, after update, after delete, after undelete){
TriggerHandler.applyLogic(Trigger);
}
//For the handler
public class TriggerHandler{
public static void(Trigger){
//Business Logic
}
//Other methods, etc...
}
It is for this reason that it seems I have to create a wrapper class that can be used to strip down the variables and pass them into my handler. Question is - how do I create such a wrapper class? I would like to include all the Trigger Context Variables including the operationType variable in the wrapper. Any help would be greatly appreciated. Many thanks in advance.