Completed
Push — master ( ccfeeb...7d9725 )
by Alexey
02:50 queued 46s
created

UserQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A overdue() 0 5 1
1
<?php
2
3
namespace modules\users\models\query;
4
5
use modules\users\models\User;
6
use yii\db\ActiveQuery;
7
use Yii;
8
9
/**
10
 * Class UserQuery
11
 * @package modules\users\models\query
12
 */
13
class UserQuery extends ActiveQuery
14
{
15
    /**
16
     * @param int $timeout
17
     * @return $this
18
     */
19
    public function overdue($timeout)
20
    {
21
        return $this
22
            ->andWhere(['status' => User::STATUS_WAIT])
23
            ->andWhere(['<', 'created_at', time() - $timeout]);
24
    }
25
}
26