Houskeeping: allow to filter for pending tasks

This commit is contained in:
Thomas Gelf 2016-03-20 15:17:34 +01:00
parent 12e849d2a4
commit 9bd54f6af5
1 changed files with 9 additions and 3 deletions

View File

@ -30,19 +30,25 @@ class Housekeeping
public function getTaskSummary() public function getTaskSummary()
{ {
return array( return array(
'oldUndeployedConfigs' => array( 'oldUndeployedConfigs' => (object) array(
'title' => N_('Undeployed configurations'), 'title' => N_('Undeployed configurations'),
'count' => $this->countOldUndeployedConfigs() 'count' => $this->countOldUndeployedConfigs()
), ),
'unusedFiles' => array( 'unusedFiles' => (object) array(
'title' => N_('Unused rendered files'), 'title' => N_('Unused rendered files'),
'count' => $this->countUnusedFiles() 'count' => $this->countUnusedFiles()
) )
); );
} }
public function getPendingTasks() public function getPendingTaskSummary()
{ {
return array_filter(
$this->getTaskSummary(),
function($task) {
return $task->count > 0;
}
);
} }
public function countOldUndeployedConfigs() public function countOldUndeployedConfigs()