Forked from hissy/clear_empty_workflow_progress.php
Last active
November 28, 2016 00:19
-
-
Save katzueno/8540e36f22d1981d1cff4b87f9929cbc to your computer and use it in GitHub Desktop.
A job to deletes empty "Compare Versions" alert to clear Workflow concrete5
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 | |
namespace Application\Job; | |
use Job as AbstractJob; | |
use Concrete\Core\Workflow\Progress\PageProgress; | |
use Concrete\Core\Workflow\EmptyWorkflow; | |
class ClearEmptyWorkflowProgress extends AbstractJob | |
{ | |
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 = PageProgress::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