- Upgraded "[_pathfinder_esi_](https://github.com/exodus4d/pathfinder_esi)" Web API client`v1.3.2` → `v2.0.0` - Fixed a js bug where current active(selected) system becomes deselected after system was dragged on map - Fixed a js bug where new auto mapped systems (e.g. after jump) were positioned outside current map scroll viewport - Fixed a js bug where map sync failed after map tabs switch - Fixed blurry map when map zoom was changed - Fixed multiple minor JS bugs where map render/update failed
97 lines
2.5 KiB
PHP
97 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Exodus4D
|
|
* Date: 15.08.2019
|
|
* Time: 22:00
|
|
*/
|
|
|
|
namespace Exodus4D\Pathfinder\Model\Universe;
|
|
|
|
use DB\SQL\Schema;
|
|
|
|
class DogmaAttributeModel extends AbstractUniverseModel {
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $table = 'dogma_attribute';
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fieldConf = [
|
|
'name' => [
|
|
'type' => Schema::DT_VARCHAR128,
|
|
'nullable' => false,
|
|
'default' => ''
|
|
],
|
|
'displayName' => [
|
|
'type' => Schema::DT_VARCHAR128,
|
|
'nullable' => true,
|
|
'default' => null
|
|
],
|
|
'description' => [
|
|
'type' => Schema::DT_TEXT
|
|
],
|
|
'published' => [
|
|
'type' => Schema::DT_BOOL,
|
|
'nullable' => true,
|
|
'default' => null
|
|
],
|
|
'stackable' => [
|
|
'type' => Schema::DT_BOOL,
|
|
'nullable' => true,
|
|
'default' => null
|
|
],
|
|
'highIsGood' => [
|
|
'type' => Schema::DT_BOOL,
|
|
'nullable' => true,
|
|
'default' => null
|
|
],
|
|
'defaultValue' => [
|
|
'type' => Schema::DT_FLOAT,
|
|
'nullable' => false,
|
|
'default' => 0
|
|
],
|
|
'iconId' => [
|
|
'type' => Schema::DT_INT,
|
|
'nullable' => true,
|
|
'default' => null
|
|
],
|
|
'unitId' => [
|
|
'type' => Schema::DT_INT,
|
|
'nullable' => true,
|
|
'default' => null
|
|
],
|
|
'attributeTypes' => [
|
|
'has-many' => ['Exodus4D\Pathfinder\Model\Universe\TypeAttributeModel', 'attributeId']
|
|
]
|
|
];
|
|
|
|
/**
|
|
* get data
|
|
* @return \stdClass
|
|
*/
|
|
public function getData(){
|
|
$attributeData = (object) [];
|
|
$attributeData->id = $this->_id;
|
|
$attributeData->name = $this->name;
|
|
$attributeData->description = $this->description;
|
|
|
|
return $attributeData;
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
* @param string $accessToken
|
|
* @param array $additionalOptions
|
|
*/
|
|
protected function loadData(int $id, string $accessToken = '', array $additionalOptions = []){
|
|
$data = self::getF3()->ccpClient()->send('getDogmaAttribute', $id);
|
|
if(!empty($data) && !isset($data['error'])){
|
|
$this->copyfrom($data, ['id', 'name', 'displayName', 'description', 'published', 'stackable', 'highIsGood', 'defaultValue', 'iconId', 'unitId']);
|
|
$this->save();
|
|
}
|
|
}
|
|
} |