- added new "select connection" feature to map - ctrl + click for multiselect, closed #174 - added new "wormhole type" table to "Jump info" dialog, closed #174 - added new re-order drag&drop feature for pannels, #470 closed #234 - fixed PHP-Doc comments - added @throw statements - fixed some Javascript memory leaks with infinite counters - updated "Peity jQuery plugin" `3.2.0` -> `3.2.1`
This commit is contained in:
84
app/main/model/connectionlogmodel.php
Normal file
84
app/main/model/connectionlogmodel.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: exodu
|
||||
* Date: 05.11.2017
|
||||
* Time: 17:51
|
||||
*/
|
||||
|
||||
namespace Model;
|
||||
|
||||
use DB\SQL\Schema;
|
||||
|
||||
class ConnectionLogModel extends BasicModel {
|
||||
|
||||
protected $table = 'connection_log';
|
||||
|
||||
protected $fieldConf = [
|
||||
'active' => [
|
||||
'type' => Schema::DT_BOOL,
|
||||
'nullable' => false,
|
||||
'default' => 1,
|
||||
'index' => true
|
||||
],
|
||||
'connectionId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true,
|
||||
'belongs-to-one' => 'Model\ConnectionModel',
|
||||
'constraint' => [
|
||||
[
|
||||
'table' => 'connection',
|
||||
'on-delete' => 'CASCADE'
|
||||
]
|
||||
]
|
||||
],
|
||||
'shipTypeId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true
|
||||
],
|
||||
'shipTypeName' => [
|
||||
'type' => Schema::DT_VARCHAR128,
|
||||
'nullable' => false,
|
||||
'default' => ''
|
||||
],
|
||||
'shipMass' => [
|
||||
'type' => Schema::DT_FLOAT,
|
||||
'nullable' => false,
|
||||
'default' => 0
|
||||
],
|
||||
'characterId' => [
|
||||
'type' => Schema::DT_INT,
|
||||
'index' => true
|
||||
],
|
||||
'characterName' => [
|
||||
'type' => Schema::DT_VARCHAR128,
|
||||
'nullable' => false,
|
||||
'default' => ''
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* get connection log data
|
||||
* @return \stdClass
|
||||
*/
|
||||
public function getData() : \stdClass {
|
||||
$logData = (object) [];
|
||||
$logData->id = $this->id;
|
||||
|
||||
$logData->connection = (object) [];
|
||||
$logData->connection->id = $this->get('connectionId', true);
|
||||
|
||||
$logData->ship = (object) [];
|
||||
$logData->ship->typeId = (int)$this->shipTypeId;
|
||||
$logData->ship->typeName = $this->shipTypeName;
|
||||
$logData->ship->mass = $this->shipMass;
|
||||
|
||||
$logData->created = (object) [];
|
||||
$logData->created->created = strtotime($this->created);
|
||||
$logData->created->character = (object) [];
|
||||
$logData->created->character->id = $this->characterId;
|
||||
$logData->created->character->name = $this->characterName;
|
||||
|
||||
return $logData;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user