Last active
June 12, 2020 05:18
-
-
Save hissy/ea2bfd97641d0dbc3b7485cb66d80e15 to your computer and use it in GitHub Desktop.
[concrete5 legacy] A job to deletes empty "Compare Versions" alerts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
class ClearEmptyWorkflowProgress extends Job | |
{ | |
public function getJobName() | |
{ | |
return t("Clear Empty Workflow Progress"); | |
} | |
public function getJobDescription() | |
{ | |
return t("Deletes empty \"Compare Versions\" alert."); | |
} | |
public function run() | |
{ | |
// retrieve all pending page workflow progresses | |
$list = PageWorkflowProgress::getPendingWorkflowProgressList(); | |
$r = $list->get(); | |
foreach ($r as $w) { | |
$wp = $w->getWorkflowProgressObject(); | |
$wo = $wp->getWorkflowObject(); | |
if ($wo instanceof EmptyWorkflow) { | |
$wp->delete(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modern Version: https://gist.github.com/hissy/5ea2147516a90710919d