/** * @inheritdoc */ public function afterSave($insert, $changedAttributes) { if ($insert) { $profile = $this->module->manager->createProfile(['user_id' => $this->_id, 'gravatar_email' => $this->email]); $profile->save(false); } parent::afterSave($insert, $changedAttributes); }