FarmFormatJSON.php in farmOS 7
File
modules/farm/farm_api/src/RestWS/Format/FarmFormatJSON.php
View source
<?php
namespace Drupal\farm_api\RestWS\Format;
use RestWSFormatJSON;
class FarmFormatJSON extends RestWSFormatJSON {
public function getResourceReference($resource, $id) {
$return = parent::getResourceReference($resource, $id);
if ($resource == 'taxonomy_term') {
$term = taxonomy_term_load($id);
if (!empty($term)) {
$return['name'] = $term->name;
}
}
return $return;
}
}
Classes
Name |
Description |
FarmFormatJSON |
Overrides the default restws response with a custom farmOS one. |