blob: b2ada1b6f5176cad706677f1deddc05f20f4a714 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
namespace Console;
use Model\Project;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ProjectDailySummaryCalculation extends Base
{
protected function configure()
{
$this
->setName('projects:daily-summary')
->setDescription('Calculate daily summary data for all projects');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$projects = $this->project->getAllByStatus(Project::ACTIVE);
foreach ($projects as $project) {
$output->writeln('Run calculation for '.$project['name']);
$this->projectDailySummary->updateTotals($project['id'], date('Y-m-d'));
}
}
}
|