Completed
Push — work-fleets ( d7065d...1ee481 )
by SuperNova.WS
08:22
created

DBStaticFleetBashing::db_bashing_insert()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace DBStatic;
4
use classSupernova;
5
use mysqli_result;
6
7
class DBStaticFleetBashing {
8
9
  /**
10
   * @param $user
11
   * @param $planet_dst
12
   * @param $time_limit
13
   *
14
   * @return array|bool|mysqli_result|null
15
   */
16
  public static function db_bashing_list_get($user, $planet_dst, $time_limit) {
17
    $query = classSupernova::$db->doSelect("SELECT bashing_time FROM {{bashing}} WHERE bashing_user_id = {$user['id']} AND bashing_planet_id = {$planet_dst['id']} AND bashing_time >= {$time_limit};");
18
19
    return $query;
20
  }
21
22
23
  /**
24
   * @param $bashing_list
25
   */
26
  public static function db_bashing_insert($bashing_list) {
27
    classSupernova::$db->doInsertValuesDeprecated(TABLE_BASHING, array('bashing_user_id', 'bashing_planet_id', 'bashing_time'), $bashing_list);
0 ignored issues
show
Deprecated Code introduced by
The method db_mysql::doInsertValuesDeprecated() has been deprecated.

This method has been deprecated.

Loading history...
28
  }
29
30
}
31