default_init
This function is defined by system. It is must to have this function in class. It is called by system when we invoke class from proess builder and any other way. It is used to pass property from system to class which can be used in class. Below are the variables passed to function from process builder:
- $data_array : All defined properties in process builder are passed in class by this array. Properties can be invoked by $data_array[‘property_name’]
- $data_array[“object_unique_id”] : It is system defined reserved variable. User can not use this variable. It is used to pass Unique_Id of current invoked Object.
- $data_array[“record_id”] : It is system defined reserved variable. User can not use this variable. It is used to pass record_id of current invoked record.
//This is the necessary function
public function default_init($data_array)
{
$this->record_id = $data_array[“record_id”];
$this->object_unique_id = $data_array[“object_unique_id”];
$this->record_array = $data_array;
}