intermediate commit

This commit is contained in:
iIronside
2022-01-07 15:04:11 +03:00
parent e16e72dcc1
commit d31a4757ff
32 changed files with 5163 additions and 270 deletions

View File

@ -2,6 +2,7 @@
namespace common\models;
use common\helpers\TransliteratorHelper;
use Yii;
use yii\helpers\ArrayHelper;
@ -10,6 +11,7 @@ use yii\helpers\ArrayHelper;
*
* @property int $id
* @property string $title
* @property string $field_template
*
* @property DocumentFieldValue[] $documentFieldValues
* @property TemplateDocumentField[] $templateDocumentFields
@ -30,10 +32,16 @@ class DocumentField extends \yii\db\ActiveRecord
public function rules()
{
return [
[['title'], 'string', 'max' => 255],
[['title', 'field_template'], 'string', 'max' => 255],
];
}
public function beforeSave($insert)
{
$this->field_template = TransliteratorHelper::transliterate($this->title);
return true;
}
/**
* {@inheritdoc}
*/
@ -42,6 +50,7 @@ class DocumentField extends \yii\db\ActiveRecord
return [
'id' => 'ID',
'title' => 'Название',
'field_template' => 'Шаблон поля',
];
}