Files
pathfinder/app/main/model/pathfinder/abstractsystemapibasicmodel.php
Mark Friedrich a33615445e - new "_NPC faction_" added for k-space systems, closed #773
- improved file structure for _Model_ classes (`app/main/model/..`). Group by database name
- improved database connection handling (fixed persistent DB connections)
2019-04-12 21:34:29 +02:00

39 lines
970 B
PHP

<?php
/**
* Created by PhpStorm.
* User: exodus4d
* Date: 25.11.15
* Time: 22:11
*/
namespace Model\Pathfinder;
use DB\SQL\Schema;
abstract class AbstractSystemApiBasicModel extends AbstractPathfinderModel {
public function __construct($db = NULL, $table = NULL, $fluid = NULL, $ttl = 0){
$this->addStaticKillFieldConfig();
parent::__construct($db, $table, $fluid, $ttl);
}
/**
* extent the fieldConf Array with static fields for each table
*/
private function addStaticKillFieldConfig(){
if(is_array($this->fieldConf)){
$staticFieldConfig = [];
for($i = 1; $i <= 24; $i++){
$staticFieldConfig['value' . $i] = [
'type' => Schema::DT_INT,
'nullable' => false,
'default' => 0,
];
}
$this->fieldConf = array_merge($this->fieldConf, $staticFieldConfig);
}
}
}