Completed
Push — master ( 215b40...7d8148 )
by Alexey
05:20
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
8
/**
9
 * Class UserQuery
10
 * @package modules\users\models\query
11
 */
12
class UserQuery extends ActiveQuery
13
{
14
    /**
15
     * @param int $timeout
16
     * @return $this
17
     */
18
    public function overdue($timeout)
19
    {
20
        return $this
21
            ->andWhere(['status' => User::STATUS_WAIT])
22
            ->andWhere(['<', 'created_at', time() - $timeout]);
23
    }
24
}
25