Completed
Push — work-fleets ( 4aef09...b4179a )
by SuperNova.WS
05:37
created

DBStaticFleetBashing::db_bashing_list_get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
class DBStaticFleetBashing {
4
5
  /**
6
   * @param $user
7
   * @param $planet_dst
8
   * @param $time_limit
9
   *
10
   * @return array|bool|mysqli_result|null
11
   */
12
  public static function db_bashing_list_get($user, $planet_dst, $time_limit) {
13
    $query = doquery("SELECT bashing_time FROM {{bashing}} WHERE bashing_user_id = {$user['id']} AND bashing_planet_id = {$planet_dst['id']} AND bashing_time >= {$time_limit};");
14
15
    return $query;
16
  }
17
18
19
  /**
20
   * @param $bashing_list
21
   */
22
  public static function db_bashing_insert($bashing_list) {
23
    doquery("INSERT INTO {{bashing}} (bashing_user_id, bashing_planet_id, bashing_time) VALUES {$bashing_list};");
24
  }
25
26
}
27