protected function TestArticles__1_0::publicFields in RESTful 7.2
Public fields.
Return value
array The field definition array.
Overrides ResourceEntity::publicFields
File
- tests/
modules/ restful_test/ src/ Plugin/ resource/ node/ test_article/ v1/ TestArticles__1_0.php, line 43 - Contains \Drupal\restful_test\Plugin\resource\node\test_article\v1\TestArticles__1_0.
Class
- TestArticles__1_0
- Class TestArticles__1_0 @package Drupal\restful\Plugin\resource
Namespace
Drupal\restful_test\Plugin\resource\node\test_article\v1Code
protected function publicFields() {
$public_fields = parent::publicFields();
if (!module_exists('entity_validator')) {
return $public_fields;
}
$public_fields['title'] = $public_fields['label'];
$public_fields['body'] = array(
'property' => 'body',
'sub_property' => 'value',
);
return $public_fields;
}