Code Duplication    Length = 11-11 lines in 2 locations

includes/classes/DBStaticPlanet.php 2 locations

@@ 192-202 (lines=11) @@
189
  }
190
191
192
  public static function db_planet_delete_by_id($planet_id) {
193
    // if(!($planet_id = intval($planet_id))) return false;
194
    if(!($planet_id = idval($planet_id))) {
195
      return false;
196
    }
197
    classSupernova::db_del_record_by_id(LOC_PLANET, $planet_id);
198
    classSupernova::db_del_record_list(LOC_UNIT, "`unit_location_type` = " . LOC_PLANET . " AND `unit_location_id` = " . $planet_id);
199
200
    // Очереди очистятся автоматически по FOREIGN KEY
201
    return true;
202
  }
203
204
  public static function db_planet_list_delete_by_owner($ui_owner_id) {
205
    // if(!($si_owner_id = intval($ui_owner_id))) return false;
@@ 204-214 (lines=11) @@
201
    return true;
202
  }
203
204
  public static function db_planet_list_delete_by_owner($ui_owner_id) {
205
    // if(!($si_owner_id = intval($ui_owner_id))) return false;
206
    if(!($si_owner_id = idval($ui_owner_id))) {
207
      return false;
208
    }
209
    classSupernova::db_del_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}");
210
    classSupernova::db_del_record_list(LOC_UNIT, "`unit_location_type` = " . LOC_PLANET . " AND `unit_player_id` = " . $si_owner_id);
211
212
    // Очереди очистятся автоматически по FOREIGN KEY
213
    return true;
214
  }
215
216
217
  public static function db_planet_count_by_type($ui_user_id, $ui_planet_type = PT_PLANET) {