Application Triggers

This is an API for you to follow in order to create your own EasySocial's application.

These are the available application triggers for the Points system in EasySocial. These triggers can be added in your application.

Available Triggers

The following are the available triggers for the points system in EasySocial:

onBeforeAssignPoints - Before assigning points to a user.

onAfterAssignPoints - After assigning points to a user.

onBeforeAssignPoints

This trigger is executed before points are assigned to the user account. It allows applications to manipulate or perform additional changes to the points if necessary.

Examples of usage:

  • You would like to integrate the points assignment with another 3rd party extension.
  • You would like to log down points on a separate system.

Code Example:

public function onBeforeAssignPoints(SocialUser $user, $points, $command)
{
    // Perform your application logic here.
}

Arguments

$user - The SocialUser library.
$points - The total number of points that is being awarded to the user.
$command - The command that is triggered for this action.


onAfterAssignPoints

This trigger is executed after points are assigned to the user account. It allows applications to manipulate or perform additional changes to the points if necessary.

Examples of usage:

  • You would like to integrate the points assignment with another 3rd party extension.
  • You would like to log down points on a separate system.

Code Example:

public function onAfterAssignPoints(SocialUser $user, $points, $command)
{
    // Perform your application logic here.
}

Arguments

$user - The SocialUser library.
$points - The total number of points that is being awarded to the user.
$command - The command that is triggered for this action.