UserQuery::overdue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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