class JSON in Apigee Edge 8
JSON formatter for Apigee Edge field storage.
Plugin annotation
@ApigeeFieldStorageFormat(
id = "json",
label = "JSON",
fields = { "*" },
weight = 1000,
)
Hierarchy
- class \Drupal\apigee_edge\Plugin\ApigeeFieldStorageFormat\JSON implements FieldStorageFormatInterface
Expanded class hierarchy of JSON
1 file declares its use of JSON
- DeveloperSyncTest.php in tests/
src/ Functional/ DeveloperSyncTest.php
File
- src/
Plugin/ ApigeeFieldStorageFormat/ JSON.php, line 34
Namespace
Drupal\apigee_edge\Plugin\ApigeeFieldStorageFormatView source
class JSON implements FieldStorageFormatInterface {
/**
* {@inheritdoc}
*/
public function encode(array $data) : string {
return json_encode($data);
}
/**
* {@inheritdoc}
*/
public function decode(string $data) : array {
return json_decode($data, TRUE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JSON:: |
public | function |
Decodes field data from the target format. Overrides FieldStorageFormatInterface:: |
|
JSON:: |
public | function |
Encodes field data to the target format. Overrides FieldStorageFormatInterface:: |