Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | protected function getNextUpdateDate(ActiveRecord $model, $interval = null) |
||
24 | { |
||
25 | if ($interval === true) { // auto calculate |
||
|
|||
26 | $interval = 1; |
||
27 | for ($i = 1; $i <= (int)$model->invalidation_count; $i++) { |
||
28 | $interval *= $i; |
||
29 | } |
||
30 | } |
||
31 | |||
32 | if (is_integer($interval)) { |
||
33 | return new Expression('DATE_ADD(NOW(), INTERVAL :interval HOUR)', [ |
||
34 | 'interval' => $interval, |
||
35 | ]); |
||
36 | } |
||
37 | |||
38 | return $interval; |
||
39 | } |
||
40 | } |