Files
pathfinder/app/main/model/universe/systemstaticmodel.php
Mark Friedrich d45fa9b527 - New "Sovereignty" and "Faction warfare" data added, closed #853
- New ESI data import for wormhole type data from _ESI_, closed #852
- New ESI data import static wormholes, closed #852
- Improved performance for character authorization (PHP). Reduced number of _SQL_ queries.
- Improved HTTP cache header for `api/map/initData`, 'api/user/getEveServerStatus' ajax requests
2019-09-10 18:14:53 +02:00

85 lines
1.9 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Exodus 4D
* Date: 18.05.2018
* Time: 17:50
*/
namespace Model\Universe;
use DB\SQL\Schema;
class SystemStaticModel extends AbstractUniverseModel {
/**
* @var string
*/
protected $table = 'system_static';
/**
* @var array
*/
protected $fieldConf = [
'systemId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\Universe\SystemModel',
'constraint' => [
[
'table' => 'system',
'on-delete' => 'CASCADE'
]
],
'validate' => 'notDry'
],
'typeId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\Universe\TypeModel',
'constraint' => [
[
'table' => 'type',
'on-delete' => 'CASCADE'
]
],
'validate' => 'notDry'
]
];
/**
* No static columns added
* @var bool
*/
protected $addStaticFields = false;
/**
* get static data
* @return null|string
*/
public function getData(){
return $this->typeId ? $this->typeId->getWormholeName() : null;
}
/**
* @param int $id
* @param string $accessToken
* @param array $additionalOptions
*/
protected function loadData(int $id, string $accessToken = '', array $additionalOptions = []){}
/**
* overwrites parent
* @param null $db
* @param null $table
* @param null $fields
* @return bool
* @throws \Exception
*/
public static function setup($db = null, $table = null, $fields = null){
if($status = parent::setup($db, $table, $fields)){
$status = parent::setMultiColumnIndex(['systemId', 'typeId'], true);
}
return $status;
}
}