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

NoStatsDataAlert   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 10 2
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
}