GetPendingActions() public static method

Get all the actions that currently need to be performed.
public static GetPendingActions ( ) : array
return array
$issuePublishEvent->dumpToHtml();

echo "Executing pending events:<br>";
$events = IssuePublish::GetPendingActions();
foreach ($events as $event) {
    $event->doAction();
    $event->dumpToHtml();
}

// Check if issues are published
echo "Is the issue published?<br>";
$issue->fetch();
$issue->dumpToHtml();

// Are the articles published?
echo "Are the articles published?<br>";
$article1->fetch();
$article1->dumpToHtml();
$article2->fetch();
$article2->dumpToHtml();

echo "Number of remaining events (should be zero): ".count(IssuePublish::GetPendingActions())."<br>";

echo "Deleting objects.<br>";
$issue->delete();
$article1->delete();
$article2->delete();
$issuePublishEvent->delete();

echo "done.<br>";
?>
Beispiel #2
0
 /**
  * Execute all pending actions.
  * @return void
  */
 public static function DoPendingActions()
 {
     $actions = IssuePublish::GetPendingActions();
     foreach ($actions as $issuePublishObj) {
         $issuePublishObj->doAction();
     }
     if (count($actions) > 0) {
         CampCache::singleton()->clear('user');
     }
     return count($actions);
 }