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_values". |
11
|
|
|
* |
12
|
|
|
* @property integer $id |
13
|
|
|
* @property string $created |
14
|
|
|
* @property string $updated |
15
|
|
|
* @property string $type |
16
|
|
|
* @property string $column_nbr |
17
|
|
|
* @property string $format |
18
|
|
|
* @property string $value_string |
19
|
|
|
* @property string $value_option |
20
|
|
|
* @property string $import_settings_set_id |
21
|
|
|
* @property string $number_delimiter |
22
|
|
|
* |
23
|
|
|
* @property \execut\import\models\Log[] $logs |
24
|
|
|
* @property \execut\import\models\SettingsSet $settingsSet |
25
|
|
|
*/ |
26
|
|
|
class SettingsValue extends ActiveRecord |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* @inheritdoc |
30
|
|
|
*/ |
31
|
|
|
public static function tableName() |
32
|
|
|
{ |
33
|
|
|
return 'import_settings_values'; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @inheritdoc |
38
|
|
|
*/ |
39
|
|
|
// public function rules() |
40
|
|
|
// { |
41
|
|
|
// return ArrayHelper::merge(parent::rules(), [ |
42
|
|
|
// [['created', 'updated'], 'safe'], |
43
|
|
|
// [['type', 'import_settings_set_id'], 'required'], |
44
|
|
|
// [['import_settings_set_id'], 'integer'], |
45
|
|
|
// [['type', 'column_nbr', 'format', 'value_string', 'value_option', 'number_delimiter'], 'string', 'max' => 255], |
46
|
|
|
// [['import_settings_set_id'], 'exist', 'skipOnError' => true, 'targetClass' => SettingsSet::class, 'targetAttribute' => ['import_settings_set_id' => 'id']], |
47
|
|
|
// ]); |
48
|
|
|
// } |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @return \yii\db\ActiveQuery |
52
|
|
|
*/ |
53
|
|
|
public function getLogs() |
54
|
|
|
{ |
55
|
|
|
return $this->hasMany(\execut\import\models\Log::class, ['import_settings_value_id' => 'id'])->inverseOf('settingsValue'); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return \yii\db\ActiveQuery |
60
|
|
|
*/ |
61
|
|
|
public function getSettingsSet() |
62
|
|
|
{ |
63
|
|
|
return $this->hasOne(\execut\import\models\SettingsSet::class, ['id' => 'import_settings_set_id'])->inverseOf('settingsValues'); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|