Completed
Push — work-fleets ( e0e753...5ee2f8 )
by SuperNova.WS
05:10
created

DBStaticUser::getOnlineTime()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 5
rs 9.4285
1
<?php
2
3
class DBStaticUser extends DBStaticRecord {
4
5
  public static $_table = 'users';
6
  public static $_idField = 'id';
7
8
9
  /**
10
   * @param int $user_id
11
   *
12
   * @return string[]
13
   */
14
  public static function getOnlineTime($user_id) {
15
    $user_record = static::getRecordById($user_id, array('username', 'onlinetime'));
16
17
    return !empty($user_record) ? $user_record : array();
18
  }
19
20
}
21