diff --git a/app/main/controller/setup.php b/app/main/controller/setup.php index 5fc9d072..b236b1fd 100644 --- a/app/main/controller/setup.php +++ b/app/main/controller/setup.php @@ -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', diff --git a/app/main/model/constellationwormholemodel.php b/app/main/model/constellationwormholemodel.php deleted file mode 100644 index c7ab3e7e..00000000 --- a/app/main/model/constellationwormholemodel.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - '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; - } -} diff --git a/app/main/model/systemwormholemodel.php b/app/main/model/systemwormholemodel.php deleted file mode 100644 index 86758032..00000000 --- a/app/main/model/systemwormholemodel.php +++ /dev/null @@ -1,62 +0,0 @@ - [ - '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; - } -} \ No newline at end of file diff --git a/app/main/model/universe/basicuniversemodel.php b/app/main/model/universe/basicuniversemodel.php index 21212d6c..125a6563 100644 --- a/app/main/model/universe/basicuniversemodel.php +++ b/app/main/model/universe/basicuniversemodel.php @@ -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 diff --git a/app/main/model/universe/wormholemodel.php b/app/main/model/universe/wormholemodel.php index 535e9842..35d4d202 100644 --- a/app/main/model/universe/wormholemodel.php +++ b/app/main/model/universe/wormholemodel.php @@ -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 = []){} } \ No newline at end of file diff --git a/app/main/model/wormholemodel.php b/app/main/model/wormholemodel.php deleted file mode 100644 index 409e2a46..00000000 --- a/app/main/model/wormholemodel.php +++ /dev/null @@ -1,110 +0,0 @@ - [ - '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; - } - -} \ No newline at end of file