guild/backend/modules/settings/models/AdditionalFields.php
2019-06-21 18:05:58 +03:00

23 lines
598 B
PHP
Executable File

<?php
namespace backend\modules\settings\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
}
}