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