Files
pathfinder/app/main/model/pathfinder/corporationstructuremodel.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

68 lines
1.6 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Exodus 4D
* Date: 15.04.2018
* Time: 19:23
*/
namespace Model\Pathfinder;
use DB\SQL\Schema;
class CorporationStructureModel extends AbstractPathfinderModel {
/**
* @var string
*/
protected $table = 'corporation_structure';
/**
* @var array
*/
protected $fieldConf = [
'active' => [
'type' => Schema::DT_BOOL,
'nullable' => false,
'default' => 1,
'index' => true
],
'corporationId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\Pathfinder\CorporationModel',
'constraint' => [
[
'table' => 'corporation',
'on-delete' => 'CASCADE'
]
]
],
'structureId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\Pathfinder\StructureModel',
'constraint' => [
[
'table' => 'structure',
'on-delete' => 'CASCADE'
]
]
]
];
/**
* 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(['corporationId', 'structureId'], true);
}
return $status;
}
}