You are here

class JSON in Apigee Edge 8

JSON formatter for Apigee Edge field storage.

Plugin annotation


@ApigeeFieldStorageFormat(
  id = "json",
  label = "JSON",
  fields = { "*" },
  weight = 1000,
)

Hierarchy

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\ApigeeFieldStorageFormat
View 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

Namesort descending Modifiers Type Description Overrides
JSON::decode public function Decodes field data from the target format. Overrides FieldStorageFormatInterface::decode
JSON::encode public function Encodes field data to the target format. Overrides FieldStorageFormatInterface::encode