Completed
Push — master ( 215b40...7d8148 )
by Alexey
05:20
created

UserQuery::overdue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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