Passed
Push — master ( c1e847...c6682b )
by Alexey
03:16
created

UserQuery::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace modules\users\models\query;
4
5
use yii\db\ActiveQuery;
6
use modules\users\models\User;
7
8
/**
9
 * This is the ActiveQuery class for [[\modules\users\models\User]].
10
 *
11
 * @see \modules\users\models\User
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