public function getAvatarFile()
{
// TODO: We might want to cache this result
$filetypes = array('jpg', 'gif', 'png');
foreach ($filetypes as $cur_type) {
// FIXME: Prepend base path for upload dir
$path = '/' . $this->id . '.' . $cur_type;
if (file_exists($path)) {
return $path;
}
}
return '';
}