Completed
Push — master ( 630902...b2c5cd )
by Paweł
05:18
created

NoStatsDataAlert::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created for IG Monitoring.
4
 * User: jakim <[email protected]>
5
 * Date: 28.06.2018
6
 */
7
8
namespace app\modules\admin\widgets;
9
10
11
use app\models\AccountStats;
12
use yii\base\Widget;
13
14
class NoStatsDataAlert extends Widget
15
{
16
    public $model;
17
18
    public function run()
19
    {
20
        $count = AccountStats::find()
21
            ->andWhere(['account_id' => $this->model->id])
22
            ->exists();
23
        if (!$count) {
24
            echo '<div class="callout callout-info">';
25
            echo '<p class="lead"><span class="fa fa-cog fa-spin"></span> Collecting data...</p>';
26
            echo '<p>Please come back tomorrow.</p>';
27
            echo '</div>';
28
        }
29
    }
30
}