Files
pathfinder/app/main/model/wormholemodel.php
Mark Friedrich ff15fc0bf9 - added new "Jump log" for selected wormhole connections, closed #313 closed #449 closed #382
- added new "select connection" feature to map - ctrl + click for multiselect, closed  #174
- added new "wormhole type" table to "Jump info" dialog, closed  #174
- added new re-order drag&drop feature for pannels, #470 closed #234
- fixed PHP-Doc comments - added @throw statements
- fixed some Javascript memory leaks with infinite counters
- updated "Peity jQuery plugin" `3.2.0` -> `3.2.1`
2017-12-04 15:12:52 +01:00

88 lines
2.2 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Exodus
* Date: 14.11.2015
* Time: 22:21
*/
namespace Model;
use DB\SQL\Schema;
class WormholeModel extends BasicModel {
protected $table = 'wormhole';
public static $enableDataExport = true;
public static $enableDataImport = true;
protected $fieldConf = [
'name' => [
'type' => Schema::DT_VARCHAR128,
'nullable' => false,
'default' => '',
'index' => true,
'unique' => true
],
'security' => [
'type' => Schema::DT_VARCHAR128,
'nullable' => false,
'default' => ''
],
'massTotal' => [
'type' => Schema::DT_VARCHAR128, // varchar because > max int value
'nullable' => false,
'default' => 0
],
'massIndividual' => [
'type' => Schema::DT_VARCHAR128, // varchar because > max int value
'nullable' => false,
'default' => 0
],
'massRegeneration' => [
'type' => Schema::DT_VARCHAR128, // varchar because > max int value
'nullable' => false,
'default' => 0
],
'maxStableTime' => [
'type' => Schema::DT_INT,
'nullable' => false,
'default' => 1,
'index' => true,
]
];
/**
* No static columns added
* @var bool
*/
protected $addStaticFields = false;
/**
* get wormhole data as object
* @return object
*/
public function getData(){
$systemStaticData = (object) [];
$systemStaticData->name = $this->name;
$systemStaticData->security = $this->security;
// total (max) available wormhole mass
$systemStaticData->massTotal = $this->massTotal;
// individual jump mass (max) per jump
$systemStaticData->massIndividual = $this->massIndividual;
// lifetime (max) for this wormhole
$systemStaticData->maxStableTime = $this->maxStableTime;
// mass regeneration value per day
if($this->massRegeneration > 0){
$systemStaticData->massRegeneration = $this->massRegeneration;
}
return $systemStaticData;
}
}