public function __get($name)Inherited
$name |
wild |
public function __set($name, $value)Inherited
$name | ||
$value |
wild |
public function current()Inherited
wild |
public function key()Inherited
wild |
public function next()Inherited
wild |
public function rewind()Inherited
wild |
public function valid()Inherited
wild |
private function throwOnAttemptedIteration()Inherited
wild |
public function getPhobjectClassConstant($key, $byte_limit)Inherited
Read the value of a class constant.
This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.
string | $key | Name of the constant. |
int|null | $byte_limit | Maximum number of bytes permitted in the value. |
string | Value of the constant. |
public function __construct($properties)Inherited
array | $properties |
this | //Implicit.// |
public function getProperties()Inherited
wild |
public function getProperty($key, $default)Inherited
$key | ||
$default |
wild |
public function validateProperties($properties)
Validate action configuration.
map<string, | $properties | wild> Map of action properties. |
void |
public function execute($last_epoch, $this_epoch)
Execute this action.
In most cases, trigger actions should queue a worker task and then exit. The actual trigger execution occurs in a locked section in the trigger daemon and blocks all other triggers. By queueing a task instead of performing processing directly, triggers can execute more involved actions without blocking other triggers.
Almost all events should use PhabricatorScheduleTaskTriggerAction to do this, ensuring that they execute quickly.
An action may trigger a long time after it is scheduled. For example, a meeting reminder may be scheduled at 9:45 AM, but the action may not execute until later (for example, because the server was down for maintenance). You can detect cases like this by comparing $this_epoch (which holds the time the event was scheduled to execute at) to PhabricatorTime::getNow() (which returns the current time). In the case of a meeting reminder, you may want to ignore the action if it executes too late to be useful (for example, after a meeting is over).
Because actions should normally queue a task and there may be a second, arbitrarily long delay between trigger execution and task execution, it may be simplest to pass the trigger time to the task and then make the decision to discard the action there.
int|null | $last_epoch | Last time the event occurred, or null if it has never triggered before. |
int | $this_epoch | The scheduled time for the current action. This may be significantly different from the current time. |
void |