$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 } }