ItemLang.php
9.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
namespace common\modules\map\models;
use Yii;
use yii\helpers\ArrayHelper;
use thread\app\base\models\ActiveRecordLang;
use common\modules\map\Map as MainModule;
/**
* Class ItemLang
*
* @property integer $rid
* @property string $lang
* @property string $description
* @property string $title
* @property string $initiator
* @property string $kind_of_economic_activity
* @property string $project_implementation_period
* @property string $investment_schedule
* @property string $financing_sources
* @property string $estimated_return_on_investment
* @property string $achieved_effect
* @property string $forms_cooperation_with_investor
* @property string $technical_parameters
* @property string $licenses
* @property string $project_documentation
* @property string $infrastructure
* @property string $talks
* @author Alla Kuzmenko
* @package common\modules\map\models
* @copyright (c), Thread
*/
class ItemLang extends ActiveRecordLang
{
const moduleName = 'map';
/**
* @return null|object|string
*/
public static function getDb()
{
return MainModule::getDb();
}
/**
* @return string
*/
public static function tableName()
{
return '{{%map_item_lang}}';
}
/**
* @return array
*/
public function rules()
{
return ArrayHelper::merge(parent::rules(), [
[['title', 'licenses'], 'required'],
['rid', 'exist', 'targetClass' => Item::class, 'targetAttribute' => 'id'],
[['title', 'address', 'project_implementation_period'], 'string', 'max' => 255],
[[
'project_documentation', 'financing_sources', 'financing_debt',
'annual_power_production', 'annual_heat_production', 'power_price', 'heat_price',
'expected_financial_return'
], 'string', 'max' => 1024],
[['description',
'investment_schedule',
'total_investment',
'investment_schedule',
'licenses_other',
'estimated_return_on_investment',
'achieved_effect', 'technical_parameters',
'contact_details_of_project_promoter',
'forms_cooperation_with_investor'], 'string', 'max' => 65535],
[['description', 'contact_details_of_project_promoter', 'total_investment'], 'default', 'value' => ' '],
]);
}
/**
* @return array
*/
public function scenarios()
{
return [
'backend' => [
'title', 'description', 'kind_of_economic_activity', 'initiator', 'project_implementation_period',
'investment_schedule', 'financing_sources', 'estimated_return_on_investment',
'achieved_effect', 'forms_cooperation_with_investor', 'technical_parameters', 'licenses',
'project_documentation', 'infrastructure', 'talks', 'expenditure_additional_infrastructure', 'address',
'contact_details_of_project_promoter', 'total_investment', 'financing_debt',
'annual_power_production', 'annual_heat_production', 'power_price', 'heat_price',
'expected_financial_return', 'licenses_other', 'investment_schedule',
],
];
}
/**
* @return array
*/
public function attributeLabels()
{
return [
'rid' => Yii::t('app', 'RID'),
'lang' => Yii::t('app', 'Lang'),
'title' => Yii::t('app', 'Title'),
'description' => Yii::t('map', 'Description'),
'kind_of_economic_activity' => Yii::t('map', 'Kind of economic activity'),
'initiator' => Yii::t('map', 'Initiator'),
'project_implementation_period' => Yii::t('map', 'Project implementation period'),
'investment_schedule' => Yii::t('map', 'investment_schedule'),
'financing_sources' => Yii::t('map', 'financing_sources'),
'financing_debt' => Yii::t('map', 'financing_debt'),
'estimated_return_on_investment' => Yii::t('map', 'estimated_return_on_investment'),
'achieved_effect' => Yii::t('map', 'achieved_effect'),
'forms_cooperation_with_investor' => Yii::t('map', 'forms_cooperation_with_investor'),
'technical_parameters' => Yii::t('map', 'technical_parameters'),
'licenses' => Yii::t('map', 'licenses'),
'project_documentation' => Yii::t('map', 'project_documentation'),
'infrastructure' => Yii::t('map', 'infrastructure'),
'talks' => Yii::t('map', 'talks'),
'address' => Yii::t('map', 'address'),
'expenditure_additional_infrastructure' => Yii::t('map', 'Expenditure on construction of additional infrastructure'),
'contact_details_of_project_promoter' => Yii::t('map', 'Contact details of project promoter'),
'total_investment' => Yii::t('map', 'total_investment'),
'annual_power_production' => Yii::t('map', 'annual_power_production'),
'annual_heat_production' => Yii::t('map', 'annual_heat_production'),
'power_price' => Yii::t('map', 'power_price'),
'heat_price' => Yii::t('map', 'heat_price'),
'expected_financial_return' => Yii::t('map', 'expected_financial_return'),
'investment' => Yii::t('map', 'Investment'),
'alias' => Yii::t('app', 'Alias'),
'type_id' => Yii::t('map', 'type'),
'area_id' => Yii::t('map', 'area'),
'user_id' => Yii::t('map', 'User'),
'gallery_image' => Yii::t('map', 'Gallery image'),
'gallery_file' => Yii::t('map', 'Gallery file'),
'youtube_link' => Yii::t('map', 'Video link'),
'web_site' => Yii::t('map', 'web_site'),
'type' => Yii::t('map', 'Type'),
'coordinates' => Yii::t('map', 'Coordinates'),
'electric_power' => Yii::t('map', 'Electric power'),
'region_id' => Yii::t('map', 'Region'),
'web_site_investor' => Yii::t('map', 'web site investor'),
'position' => Yii::t('app', 'Position'),
'created_at' => Yii::t('app', 'Create time'),
'updated_at' => Yii::t('app', 'Update time'),
'published' => Yii::t('app', 'Published'),
'deleted' => Yii::t('app', 'Deleted'),
'heat_capacity' => Yii::t('map', 'heat_capacity'),
'type_of_promoter' => Yii::t('map', 'type_of_promoter'),
'date_of_entry' => Yii::t('map', 'date_of_entry'),
'share_of_project_equity_offered' => Yii::t('map', 'Share of project equity offered'),
'current_stage_of_project_development' => Yii::t('map', 'Current stage of project development'),
'licenses_other' => Yii::t('map', 'licenses_other'),
'investment_schedule' => Yii::t('map', 'Investment schedule (monthly or quarterly)'),
];
}
/**
* @return array
*/
public static function licensesRangeListUA()
{
return [
'Оренда землі для будівництва' => 'Оренда землі для будівництва',
'Право власності на землю' => 'Право власності на землю',
'Договір про приєднання до електричних мереж' => 'Договір про приєднання до електричних мереж',
'Договір про приєднання до теплових мереж' => 'Договір про приєднання до теплових мереж',
'Дозвіл на будівництво' => 'Дозвіл на будівництво',
'Ліцензія на виробництво електроенергії' => 'Ліцензія на виробництво електроенергії',
'Ліцензія на виробництво теплової енергії' => 'Ліцензія на виробництво теплової енергії',
'Ліцензія на комбіноване виробництво електричної та теплової енергії' => 'Ліцензія на комбіноване виробництво електричної та теплової енергії',
'Заява на отримання "зеленого" тарифу' => 'Заява на отримання "зеленого" тарифу',
'Інші' => 'Інші',
];
}
/**
* @return array
*/
public static function licensesRangeListEN()
{
return [
'Lease for land for construction' => 'Lease for land for construction',
'Ownership for land' => 'Ownership for land',
'Agreement on connection to the electricity grid' => 'Agreement on connection to the electricity grid',
'Agreement on connection to heat off-taker (if relevant)' => 'Agreement on connection to heat off-taker (if relevant)',
'Construction permit' => 'Construction permit',
'License to produce electric energy' => 'License to produce electric energy',
'License to produce heat energy' => 'License to produce heat energy',
'License to produce combined heat and electricity' => 'License to produce combined heat and electricity',
'Application for Green tariff' => 'Application for Green tariff',
'Others' => 'Others',
];
}
}