UserQuery::overdue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 5
rs 10
cc 1
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
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