- Upgraded "[_Select2_](https://select2.org/)" js lib `v4.0.6-rc.1` → `v4.0.13` - Fixed some issues where changed map settings (e.g. "share") do not get updated/stored, closed #889, closed #925 - Moved ajax endpoints for map create/update/delete into `/Api/Rest/` dir - Minor UI improvements for "manual dialog" (fixed pixelated text)
99 lines
2.2 KiB
PHP
99 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Exodus 4D
|
|
* Date: 28.01.2018
|
|
* Time: 14:38
|
|
*/
|
|
|
|
namespace Exodus4D\Pathfinder\Model\Pathfinder;
|
|
|
|
use DB\SQL\Schema;
|
|
|
|
class RightModel extends AbstractPathfinderModel {
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $table = 'right';
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fieldConf = [
|
|
'active' => [
|
|
'type' => Schema::DT_BOOL,
|
|
'nullable' => false,
|
|
'default' => 1,
|
|
'index' => true
|
|
],
|
|
'name' => [
|
|
'type' => Schema::DT_VARCHAR128,
|
|
'nullable' => false,
|
|
'default' => '',
|
|
'index' => true,
|
|
'unique' => true
|
|
],
|
|
'label' => [
|
|
'type' => Schema::DT_VARCHAR128,
|
|
'nullable' => false,
|
|
'default' => ''
|
|
],
|
|
'description' => [
|
|
'type' => Schema::DT_VARCHAR512,
|
|
'nullable' => false,
|
|
'default' => ''
|
|
],
|
|
'corporationRights' => [
|
|
'has-many' => ['Exodus4D\Pathfinder\Model\Pathfinder\CorporationRightModel', 'rightId']
|
|
]
|
|
];
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected static $tableData = [
|
|
[
|
|
'id' => 1,
|
|
'name' => 'map_update',
|
|
'label' => 'update',
|
|
'description' => 'Map settings update right'
|
|
],
|
|
[
|
|
'id' => 2,
|
|
'name' => 'map_delete',
|
|
'label' => 'delete',
|
|
'description' => 'Map delete right'
|
|
],
|
|
[
|
|
'id' => 3,
|
|
'name' => 'map_import',
|
|
'label' => 'import',
|
|
'description' => 'Map import right'
|
|
],
|
|
[
|
|
'id' => 4,
|
|
'name' => 'map_export',
|
|
'label' => 'export',
|
|
'description' => 'Map export right'
|
|
],
|
|
[
|
|
'id' => 5,
|
|
'name' => 'map_share',
|
|
'label' => 'share',
|
|
'description' => 'Map share right'
|
|
]
|
|
];
|
|
|
|
/**
|
|
* get right data
|
|
* @return \stdClass
|
|
*/
|
|
public function getData(){
|
|
$rightData = (object) [];
|
|
|
|
$rightData->name = $this->name;
|
|
|
|
return $rightData;
|
|
}
|
|
} |