2018-10-11 11:15:09 +03:00
|
|
|
<?php
|
|
|
|
|
2018-10-12 14:52:08 +03:00
|
|
|
namespace backend\modules\settings\models;
|
2018-10-11 11:15:09 +03:00
|
|
|
|
|
|
|
use common\models\UseStatus;
|
|
|
|
|
|
|
|
class Status extends \common\models\Status
|
|
|
|
{
|
|
|
|
public function afterSave($insert, $changedAttributes)
|
|
|
|
{
|
|
|
|
UseStatus::deleteAll(['status_id' => $this->id]);
|
|
|
|
foreach ($this->use as $item) {
|
|
|
|
$useStatus = new UseStatus();
|
|
|
|
$useStatus->status_id = $this->id;
|
|
|
|
$useStatus->use = $item;
|
|
|
|
|
|
|
|
$useStatus->save();
|
|
|
|
}
|
|
|
|
|
|
|
|
parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
|
|
|
|
}
|
|
|
|
}
|