public function getAvatarUrl() { if ($this->profile && $this->profile->avatar) { return $this->profile->avatar->url; } else { return Module::avatarDefaultUrl(); } }