Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Created October 20, 2011 23:28
Show Gist options
  • Save aaronshaf/1302703 to your computer and use it in GitHub Desktop.
Save aaronshaf/1302703 to your computer and use it in GitHub Desktop.
Media::applyFilter('_handle',function($self, $params, $chain) {
if(!empty($params['data'])) {
foreach($params['data'] as &$data) {
if(!is_object($data))
continue;
$data = $data->to('array');
}
}
return $chain->next($self, $params, $chain);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment