class JsonEncoder in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/serializer/Encoder/JsonEncoder.php \Symfony\Component\Serializer\Encoder\JsonEncoder
- 8 core/modules/hal/src/Encoder/JsonEncoder.php \Drupal\hal\Encoder\JsonEncoder
- 8 core/modules/serialization/src/Encoder/JsonEncoder.php \Drupal\serialization\Encoder\JsonEncoder
Same name and namespace in other branches
- 8.0 core/modules/hal/src/Encoder/JsonEncoder.php \Drupal\hal\Encoder\JsonEncoder
Encodes HAL data in JSON.
Simply respond to hal_json format requests using the JSON encoder.
Hierarchy
- class \Symfony\Component\Serializer\Encoder\JsonEncoder implements DecoderInterface, EncoderInterface
- class \Drupal\hal\Encoder\JsonEncoder
Expanded class hierarchy of JsonEncoder
2 files declare their use of JsonEncoder
- FileNormalizeTest.php in core/
modules/ hal/ src/ Tests/ FileNormalizeTest.php - Contains \Drupal\hal\Tests\FileNormalizeTest.
- NormalizerTestBase.php in core/
modules/ hal/ src/ Tests/ NormalizerTestBase.php - Contains \Drupal\hal\Tests\NormalizerTestBase.
1 string reference to 'JsonEncoder'
- hal.services.yml in core/
modules/ hal/ hal.services.yml - core/modules/hal/hal.services.yml
1 service uses JsonEncoder
- serializer.encoder.hal in core/
modules/ hal/ hal.services.yml - Drupal\hal\Encoder\JsonEncoder
File
- core/
modules/ hal/ src/ Encoder/ JsonEncoder.php, line 17 - Contains \Drupal\hal\Encoder\JsonEncoder.
Namespace
Drupal\hal\EncoderView source
class JsonEncoder extends SymfonyJsonEncoder {
/**
* The formats that this Encoder supports.
*
* @var string
*/
protected $format = 'hal_json';
/**
* {@inheritdoc}
*/
public function supportsEncoding($format) {
return $format == $this->format;
}
/**
* {@inheritdoc}
*/
public function supportsDecoding($format) {
return $format == $this->format;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JsonEncoder:: |
protected | property | ||
JsonEncoder:: |
protected | property | ||
JsonEncoder:: |
protected | property | The formats that this Encoder supports. | |
JsonEncoder:: |
public | function |
Decodes a string into PHP data. Overrides DecoderInterface:: |
|
JsonEncoder:: |
public | function |
Encodes data into the given format. Overrides EncoderInterface:: |
|
JsonEncoder:: |
constant | |||
JsonEncoder:: |
public | function | Returns the last decoding error (if any). | |
JsonEncoder:: |
public | function | Returns the last encoding error (if any). | |
JsonEncoder:: |
public static | function | Resolves json_last_error message. | |
JsonEncoder:: |
public | function |
Checks whether the deserializer can decode from given format. Overrides JsonEncoder:: |
|
JsonEncoder:: |
public | function |
Checks whether the serializer can encode to given format. Overrides JsonEncoder:: |
|
JsonEncoder:: |
public | function |