Files
pathfinder/app/main/model/alliancemapmodel.php
Exodus4D ca1cbb0e06 - new UI option for "delete expired connections", #219
- new cronjob for  "delete expired connections", #219
- fixed "not updating" map changes, closed #357
- improved caching strategy for DB models (file cache)
- improved "map sharing"
2016-10-23 20:08:10 +02:00

72 lines
1.6 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: exodus4d
* Date: 19.05.2015
* Time: 20:14
*/
namespace Model;
use DB\SQL\Schema;
class AllianceMapModel extends BasicModel {
protected $table = 'alliance_map';
protected $fieldConf = [
'active' => [
'type' => Schema::DT_BOOL,
'nullable' => false,
'default' => 1,
'index' => true
],
'allianceId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\AllianceModel',
'constraint' => [
[
'table' => 'alliance',
'on-delete' => 'CASCADE'
]
]
],
'mapId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\MapModel',
'constraint' => [
[
'table' => 'map',
'on-delete' => 'CASCADE'
]
]
]
];
/**
* see parent
*/
public function clearCacheData(){
// clear map cache
$this->mapId->clearCacheData();
}
/**
* 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(['allianceId', 'mapId'], true);
}
return $status;
}
}