Skip to content

Instantly share code, notes, and snippets.

@romaninsh
Created August 15, 2012 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romaninsh/3361810 to your computer and use it in GitHub Desktop.
Save romaninsh/3361810 to your computer and use it in GitHub Desktop.
$m=$this;
$m->thumb=$m
->leftJoin('filestore_file','filestore_file_id')
->leftJoin('filestore_image.original_file_id',null,'left')
->leftJoin('filestore_file','thumb_file_id','left');
;
$m->vol=$m->thumb->leftJoin('filestore_volume',null,'left');
$m->addExpression('thumb',function($m,$s){
return $s->expr(
'COALESCE(
concat('.
$m->vol->fieldExpr('dirname').
',"/",'.
$m->thumb->fieldExpr('filename').
')
, "templates/default/images/profile.jpg") ');
})->visible(true);
@romaninsh
Copy link
Author

for the single user, you can use this:

$path = $user->ref('filestore_file_id')->getPath();

(this shows the full image)

@romaninsh
Copy link
Author

$path = $user->ref('filestore_file_id')->ref('thumb_file_id')->getPath();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment