public function RestfulExampleRoleResource::publicFieldsInfo in RESTful 7
Overrides \RestfulEntityBase::publicFields().
Overrides RestfulEntityBase::publicFieldsInfo
File
- modules/
restful_example/ plugins/ restful/ node/ per_role_content/ 1.0/ RestfulExampleRoleResource.class.php, line 23 - Contains RestfulExampleRoleResource.
Class
- RestfulExampleRoleResource
- @file Contains RestfulExampleRoleResource.
Code
public function publicFieldsInfo() {
$public_fields = parent::publicFieldsInfo();
$public_fields['type'] = array(
'property' => 'type',
'wrapper_method' => 'getBundle',
'wrapper_method_on_entity' => TRUE,
);
$public_fields['roles'] = array(
'property' => 'author',
'sub_property' => 'roles',
'wrapper_method' => 'label',
);
return $public_fields;
}