- removed table "constellation_wormhole" (no longer needed), #628
- removed table "system_wormhole" (no longer needed), #628 - removed table "wormhole" (no longer needed), #628
This commit is contained in:
@@ -67,7 +67,6 @@ class Setup extends Controller {
|
||||
'Model\SystemTypeModel',
|
||||
'Model\SystemStatusModel',
|
||||
'Model\SystemNeighbourModel',
|
||||
'Model\WormholeModel',
|
||||
'Model\RightModel',
|
||||
'Model\RoleModel',
|
||||
'Model\StructureModel',
|
||||
@@ -89,8 +88,6 @@ class Setup extends Controller {
|
||||
'Model\CharacterLogModel',
|
||||
|
||||
'Model\SystemModel',
|
||||
'Model\SystemWormholeModel',
|
||||
'Model\ConstellationWormholeModel',
|
||||
|
||||
'Model\ConnectionModel',
|
||||
'Model\ConnectionLogModel',
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: exodus4d
|
||||
* Date: 07.06.15
|
||||
* Time: 18:16
|
||||
*/
|
||||
|
||||
namespace Model;
|
||||
|
||||
use DB\SQL\Schema;
|
||||
|
||||
class ConstellationWormholeModel extends BasicModel {
|
||||
|
||||
protected $table = 'constellation_wormhole';
|
||||
|
||||
public static $enableDataExport = true;
|
||||
public static $enableDataImport = true;
|
||||
|
||||
protected $fieldConf = [
|
||||
'constellationId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true,
|
||||
],
|
||||
'wormholeId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true,
|
||||
'belongs-to-one' => 'Model\WormholeModel',
|
||||
'constraint' => [
|
||||
[
|
||||
'table' => 'wormhole',
|
||||
'on-delete' => 'CASCADE'
|
||||
]
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* get wormhole data as object
|
||||
* @return object
|
||||
*/
|
||||
public function getData(){
|
||||
return $this->wormholeId->getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* overwrites parent
|
||||
* @param null $db
|
||||
* @param null $table
|
||||
* @param null $fields
|
||||
* @return bool
|
||||
*/
|
||||
public static function setup($db=null, $table=null, $fields=null){
|
||||
$status = parent::setup($db,$table,$fields);
|
||||
|
||||
if($status === true){
|
||||
$status = parent::setMultiColumnIndex(['constellationId', 'wormholeId'], true);
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Exodus
|
||||
* Date: 16.07.2016
|
||||
* Time: 12:19
|
||||
*/
|
||||
|
||||
namespace Model;
|
||||
|
||||
use DB\SQL\Schema;
|
||||
|
||||
class SystemWormholeModel extends BasicModel {
|
||||
|
||||
protected $table = 'system_wormhole';
|
||||
|
||||
public static $enableDataExport = true;
|
||||
public static $enableDataImport = true;
|
||||
|
||||
protected $fieldConf = [
|
||||
'systemId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true,
|
||||
],
|
||||
'wormholeId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true,
|
||||
'belongs-to-one' => 'Model\WormholeModel',
|
||||
'constraint' => [
|
||||
[
|
||||
'table' => 'wormhole',
|
||||
'on-delete' => 'CASCADE'
|
||||
]
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* get wormhole data as object
|
||||
* @return object
|
||||
*/
|
||||
public function getData(){
|
||||
return $this->wormholeId->getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* overwrites parent
|
||||
* @param null $db
|
||||
* @param null $table
|
||||
* @param null $fields
|
||||
* @return bool
|
||||
*/
|
||||
public static function setup($db=null, $table=null, $fields=null){
|
||||
$status = parent::setup($db,$table,$fields);
|
||||
|
||||
if($status === true){
|
||||
$status = parent::setMultiColumnIndex(['systemId', 'wormholeId'], true);
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
@@ -159,21 +159,6 @@ abstract class BasicUniverseModel extends BasicModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load data by foreign key or other column than "id"
|
||||
* @param string $key
|
||||
* @param $value
|
||||
*/
|
||||
public function loadByKey(string $key, $value){
|
||||
/**
|
||||
* @var $model self
|
||||
*/
|
||||
$model = $this->getByForeignKey($key, $value, ['limit' => 1]);
|
||||
if($model->isOutdated()){
|
||||
$model->loadDataByKey($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load data from API into $this and save $this
|
||||
* @param int $id
|
||||
@@ -182,8 +167,6 @@ abstract class BasicUniverseModel extends BasicModel {
|
||||
*/
|
||||
abstract protected function loadData(int $id, string $accessToken = '', array $additionalOptions = []);
|
||||
|
||||
protected function loadDataByKey(string $key, $value){}
|
||||
|
||||
/**
|
||||
* generate hashKey for a table row data for search index build
|
||||
* @param string $table
|
||||
|
||||
@@ -182,25 +182,6 @@ class WormholeModel extends BasicUniverseModel {
|
||||
return parent::exportData($fields);
|
||||
}
|
||||
|
||||
protected function loadData(int $id, string $accessToken = '', array $additionalOptions = []){
|
||||
var_dump('loadData');
|
||||
var_dump($id);
|
||||
/*
|
||||
$data = self::getF3()->ccpClient->getUniverseTypesData($id, $additionalOptions);
|
||||
if(!empty($data)){
|
||||
$group = $this->rel('groupId');
|
||||
$group->loadById($data['groupId'], $accessToken, $additionalOptions);
|
||||
$data['groupId'] = $group;
|
||||
|
||||
$this->copyfrom($data);
|
||||
$this->save();
|
||||
} */
|
||||
}
|
||||
|
||||
protected function loadDataByKey(string $key, $value){
|
||||
var_dump('loadData');
|
||||
var_dump($key);
|
||||
var_dump($value);
|
||||
}
|
||||
protected function loadData(int $id, string $accessToken = '', array $additionalOptions = []){}
|
||||
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
<?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,
|
||||
],
|
||||
'signatureStrength' => [
|
||||
'type' => Schema::DT_FLOAT,
|
||||
'nullable' => true,
|
||||
'default' => null
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* No static columns added
|
||||
* @var bool
|
||||
*/
|
||||
protected $addStaticFields = false;
|
||||
|
||||
/**
|
||||
* setter for "signatureStrength"
|
||||
* @param $value
|
||||
* @return mixed|null|string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function set_signatureStrength($value){
|
||||
$value = (float)$value ? $value : null;
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
// signature strength as defined by http://wiki.eve-inspiracy.com/index.php?title=Wormhole_Signature_Strength_List
|
||||
if($this->signatureStrength){
|
||||
$systemStaticData->signatureStrength = $this->signatureStrength;
|
||||
}
|
||||
|
||||
return $systemStaticData;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user