protected function prepareSave() { if (!($profile = $this->getUserProfile())) { $this->assignUserProfile(); } parent::prepareSave(); }
protected function prepareSave() { $this->getData('avatar') or $this->setData('avatar', $this->generateAvatarUrl()); $this->extra_data or $this->extra_data = []; parent::prepareSave(); }