You are here

protected function Main__1_7::processPublicFields in RESTful 7.2

Get the public fields with the default values applied to them.

Parameters

array $field_definitions: The field definitions to process.

Return value

array The field definition array.

Throws

\Drupal\restful\Exception\ServerConfigurationException For resources without ID field.

Overrides ResourceEntity::processPublicFields

File

tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_7.php, line 99
Contains \Drupal\restful_test\Plugin\resource\entity_test\main\v1\Main__1_7.

Class

Main__1_7
Class Main__1_7 @package Drupal\restful_test\Plugin\resource

Namespace

Drupal\restful_test\Plugin\resource\entity_test\main\v1

Code

protected function processPublicFields(array $field_definitions) {
  if (variable_get('restful_test_alternative_id_error', FALSE)) {

    // Single entity reference field with "resource" that does not load by
    // uuid.
    $field_definitions['entity_reference_resource_error'] = array(
      'property' => 'entity_reference_single',
      'referencedIdProperty' => 'uuid',
      'resource' => array(
        'name' => 'main',
        'majorVersion' => 1,
        'minorVersion' => 6,
      ),
    );
  }
  return parent::processPublicFields($field_definitions);
}