UserQuery   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
eloc 4
c 2
b 1
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A overdue() 0 5 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