guild/backend/modules/fields/models/AdditionalFields.php

23 lines
596 B
PHP
Raw Normal View History

2018-10-11 11:15:09 +03:00
<?php
namespace backend\modules\fields\models;
use common\classes\Debug;
use common\models\UseField;
class AdditionalFields extends \common\models\AdditionalFields
{
public function afterSave($insert, $changedAttributes)
{
UseField::deleteAll(['field_id' => $this->id]);
foreach ($this->use as $item) {
$useField = new UseField();
$useField->field_id = $this->id;
$useField->use = $item;
$useField->save();
}
parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
}
}