Completed
Push — work-fleets ( 23812c...abbbcf )
by SuperNova.WS
05:51
created

TestDBRow::dbLoad()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
define('DEBUG_INIT_SKIP_SECONDARY', true);
4
5
require_once "../includes/init.php";
6
7
//$player = new Player();
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
8
//$player->db_load_by_id(2);
9
//$player->unitList->_dump();
10
//pvar_dump($player->player_bonus);
11
12
13
class TestDBRow extends DBRow {
14
15
  public static $_table = '';
16
  public static $_dbIdFieldName = 'id';
17
  public static $_properties = array(
18
    'dbId' => array(
19
      P_DB_FIELD => 'id',
20
    ),
21
  );
22
23
  public function __construct() {
24
    parent::__construct();
25
  }
26
27
  public function __get($name) {
28
    return parent::__get($name); // TODO: Change the autogenerated stub
29
  }
30
31
  public function __set($name, $value) {
32
    parent::__set($name, $value); // TODO: Change the autogenerated stub
33
  }
34
35
  public function dbLoad($dbId) {
36
    return parent::dbLoad($dbId); // TODO: Change the autogenerated stub
37
  }
38
39
  public function dbSave() {
40
    parent::dbSave(); // TODO: Change the autogenerated stub
41
  }
42
43
  public function dbInsert() {
44
    return parent::dbInsert(); // TODO: Change the autogenerated stub
45
  }
46
47
  public function dbUpdate() {
48
    parent::dbUpdate(); // TODO: Change the autogenerated stub
49
  }
50
51
  public function dbDelete() {
52
    parent::dbDelete(); // TODO: Change the autogenerated stub
53
  }
54
55
56
  public function isNew() {
57
    return parent::isNew(); // TODO: Change the autogenerated stub
58
  }
59
60
  /**
61
   * Является ли запись пустой - т.е. при исполнении _dbSave должен быть удалён
62
   *
63
   * @return bool
64
   */
65
  public function isEmpty() {
66
    // TODO: Implement isEmpty() method.
67
  }
68
69
  public function dbRowParse(array $db_row) {
70
    parent::dbRowParse($db_row); // TODO: Change the autogenerated stub
71
  }
72
73
  public function dbMakeFieldSet($isUpdate = false) {
74
    return parent::dbMakeFieldSet($isUpdate); // TODO: Change the autogenerated stub
75
  }
76
77
  public function db_field_set_create(array $field_set) {
78
    return parent::db_field_set_create($field_set); // TODO: Change the autogenerated stub
79
  }
80
  public function db_field_update(array $field_set) {
81
    return parent::db_field_update($field_set); // TODO: Change the autogenerated stub
82
  }
83
84
  public function isFieldChanged($fieldName) {
85
    return parent::isFieldChanged($fieldName); // TODO: Change the autogenerated stub
86
  }
87
88
}
89
90
/*
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
91
lh__test
92
93
id
94
abigint
95
adatetime
96
astring
97
afloat
98
adecimal
99
res_metal
100
res_crystal
101
102
-- ----------------------------
103
-- Table structure for lh__test
104
-- ----------------------------
105
DROP TABLE IF EXISTS `lh__test`;
106
CREATE TABLE `lh__test` (
107
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
108
  `abigint` bigint(20) DEFAULT NULL,
109
  `adatetime` datetime DEFAULT NULL,
110
  `astring` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
111
  `afloat` float DEFAULT NULL,
112
  `adecimal` decimal(64,8) DEFAULT NULL,
113
  `res_metal` decimal(64,4) DEFAULT NULL,
114
  `res_crystal` decimal(64,0) DEFAULT NULL,
115
  PRIMARY KEY (`id`)
116
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
117
118
 */
119
120
sn_db_transaction_start();
121
//$fleet = new Fleet();
0 ignored issues
show
Unused Code Comprehensibility introduced by
49% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
122
//
123
//$raisedError = false;
124
//try {
125
//  $fleet->dbSave();
126
//} catch (Exception $e) {
127
//  $raisedError = true;
128
//}
129
130
//$fleet->dbLoad(103);
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
131
//
132
////$fleet_row = doquery("SELECT * FROM {{fleets}} WHERE fleet_id = 80;", true);
133
////$fleet_row = doquery("SELECT * FROM {{fleets}} WHERE fleet_id = 8;", true);
134
////pdump($fleet_row);
135
////$fleet->dbRowParse($fleet_row);
136
////pdie('disabled for debug purposes');
137
//
138
////$fleet->setDbId(0);
139
////$fleet->unitList->unitZeroDbId();
140
////pvar_dump($fleet->unitList[1131268]);
141
////pdie('disabled for debug purposes');
142
//
143
//
144
//
145
//pdump(property_exists($fleet->unitList[1131268], 'count'), 'count exists');
146
//pdump($fleet->unitList[1131268]->count);
147
//$fleet->unitList[1131268]->adjustCount(-1);
148
//pdump($fleet->unitList[1131268]->count);
149
//
150
//$fleet->dbSave();
151
//
152
//pvar_dump($fleet->unitList);
153
//
154
////$fleet->unitList->unitZeroCount();
155
////$fleet->dbSave();
156
157
//pdie('disabled for debug purposes');
158
159
160
//sn_db_transaction_commit();
161
162
pdie('tests completed');