protected function RestfulExampleArticlesResource__1_5::imageProcess in RESTful 7
Process callback, Remove Drupal specific items from the image array.
Parameters
array $value: The image array.
Return value
array A cleaned image array.
File
- modules/
restful_example/ plugins/ restful/ node/ articles/ 1.5/ RestfulExampleArticlesResource__1_5.class.php, line 77 - Contains RestfulExampleArticlesResource__1_5.
Class
- RestfulExampleArticlesResource__1_5
- @file Contains RestfulExampleArticlesResource__1_5.
Code
protected function imageProcess($value) {
if (static::isArrayNumeric($value)) {
$output = array();
foreach ($value as $item) {
$output[] = $this
->imageProcess($item);
}
return $output;
}
return array(
'id' => $value['fid'],
'self' => file_create_url($value['uri']),
'filemime' => $value['filemime'],
'filesize' => $value['filesize'],
'width' => $value['width'],
'height' => $value['height'],
'styles' => $value['image_styles'],
);
}