GetPendingActions() 공개 정적인 메소드

Get all the actions that currently need to be performed.
public static GetPendingActions ( ) : array
리턴 array
예제 #1
0
$articlePublishObj2 = new ArticlePublish($newArticle->getArticleId(), 1, $datetime);
$articlePublishObj2->create();
$articlePublishObj2->setPublishAction('P');

// Verify
echo "Number of pending actions (should be zero): ".count(ArticlePublish::GetPendingActions())."<br>";

// Schedule past event
echo "Scheduling past event...<br>";
$datetime = strftime("1900-%m-%d %H:%M:00");
$articlePublishObj3 = new ArticlePublish($newArticle->getArticleId(), 1, $datetime);
$articlePublishObj3->create();
$articlePublishObj3->setPublishAction('P');

// Verify
echo "Number of pending actions (should be one): ".count(ArticlePublish::GetPendingActions())."<br>";

// delete the article
echo "Deleting the article.<br>";
$newArticle->delete();

echo "Deleting the events.<br>";
$articlePublishObj->delete();
$articlePublishObj2->delete();
$articlePublishObj3->delete();

echo "<h2>ISSUE AUTOPUBLISH TESTS</h2>";
echo "Creating an issue...<br>";
$issueId = rand();
$issue = new Issue(1, 1, $issueId);
$issue->create($issueId);
예제 #2
0
	/**
	 * Execute all pending actions.
	 * @return void
	 */
	public static function DoPendingActions()
	{
        $actions = ArticlePublish::GetPendingActions();
    	foreach ($actions as $articlePublishObj) {
    	    $articlePublishObj->doAction();
    	}
        if (count($actions) > 0) {
            CampCache::singleton()->clear('user');
        }
        return count($actions);
	} // fn DoPendingActions