|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace execut\import\models\base; |
|
4
|
|
|
|
|
5
|
|
|
use Yii; |
|
6
|
|
|
use yii\db\ActiveRecord; |
|
7
|
|
|
use yii\helpers\ArrayHelper; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* This is the model class for table "import_settings_sheets". |
|
11
|
|
|
* |
|
12
|
|
|
* @property integer $id |
|
13
|
|
|
* @property string $created |
|
14
|
|
|
* @property string $updated |
|
15
|
|
|
* @property string $name |
|
16
|
|
|
* @property integer $order |
|
17
|
|
|
* @property string $import_setting_id |
|
18
|
|
|
* |
|
19
|
|
|
* @property \execut\import\models\SettingsSet[] $settingsSets |
|
20
|
|
|
* @property \execut\import\models\Setting $setting |
|
21
|
|
|
*/ |
|
22
|
|
|
class SettingsSheet extends ActiveRecord |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* @inheritdoc |
|
26
|
|
|
*/ |
|
27
|
|
|
public static function tableName() |
|
28
|
|
|
{ |
|
29
|
|
|
return 'import_settings_sheets'; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
// /** |
|
33
|
|
|
// * @inheritdoc |
|
34
|
|
|
// */ |
|
35
|
|
|
// public function rules() |
|
36
|
|
|
// { |
|
37
|
|
|
// return ArrayHelper::merge(parent::rules(), [ |
|
38
|
|
|
// [['created', 'updated'], 'safe'], |
|
39
|
|
|
// [['name', 'order', 'import_setting_id'], 'required'], |
|
40
|
|
|
// [['order', 'import_setting_id'], 'integer'], |
|
41
|
|
|
// [['name'], 'string', 'max' => 255], |
|
42
|
|
|
// [['import_setting_id'], 'exist', 'skipOnError' => true, 'targetClass' => Setting::class, 'targetAttribute' => ['import_setting_id' => 'id']], |
|
43
|
|
|
// ]); |
|
44
|
|
|
// } |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return \yii\db\ActiveQuery |
|
48
|
|
|
*/ |
|
49
|
|
|
public function getSettingsSets() |
|
50
|
|
|
{ |
|
51
|
|
|
return $this->hasMany(\execut\import\models\SettingsSet::class, ['import_settings_sheet_id' => 'id'])->inverseOf('settingsSheet'); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @return \yii\db\ActiveQuery |
|
56
|
|
|
*/ |
|
57
|
|
|
public function getSetting() |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->hasOne(\execut\import\models\Setting::class, ['id' => 'import_setting_id'])->inverseOf('settingsSheets'); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|