2019-06-25 12:37:09 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace common\models;
|
|
|
|
|
|
|
|
use Yii;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the model class for table "fields_value_new".
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property int $field_id
|
|
|
|
* @property int $item_id
|
|
|
|
* @property int $item_type
|
|
|
|
* @property int $order
|
|
|
|
* @property string $value
|
2019-07-26 12:32:43 +03:00
|
|
|
* @property string $option
|
2019-07-26 15:31:39 +03:00
|
|
|
* @property string $type_file
|
2019-06-25 12:37:09 +03:00
|
|
|
*/
|
|
|
|
class FieldsValueNew extends \yii\db\ActiveRecord
|
|
|
|
{
|
|
|
|
const TYPE_PROFILE = 0;
|
|
|
|
const TYPE_PROJECT = 1;
|
|
|
|
const TYPE_COMPANY = 2;
|
|
|
|
const TYPE_BALANCE = 3;
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public static function tableName()
|
|
|
|
{
|
|
|
|
return 'fields_value_new';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
[['field_id', 'item_id', 'item_type'], 'required'],
|
|
|
|
[['field_id', 'item_id', 'item_type', 'order'], 'integer'],
|
2019-07-26 12:32:43 +03:00
|
|
|
[['value', 'type_file'], 'string'],
|
2019-06-25 12:37:09 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function attributeLabels()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => 'ID',
|
|
|
|
'field_id' => 'Field ID',
|
|
|
|
'item_id' => 'Item ID',
|
|
|
|
'item_type' => 'Item Type',
|
|
|
|
'order' => 'Order',
|
|
|
|
'value' => 'Value',
|
2019-07-26 12:32:43 +03:00
|
|
|
'type_file' => 'Приложение'
|
2019-06-25 12:37:09 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \yii\db\ActiveQuery
|
|
|
|
*/
|
|
|
|
public function getField()
|
|
|
|
{
|
|
|
|
return $this->hasOne(AdditionalFields::class, ['id' => 'field_id']);
|
|
|
|
}
|
2019-06-25 18:28:20 +03:00
|
|
|
|
2019-06-25 12:37:09 +03:00
|
|
|
}
|