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/serialization/src/Encoder/JsonEncoder.php \Drupal\serialization\Encoder\JsonEncoder
Adds 'ajax to the supported content types of the JSON encoder'
Hierarchy
- class \Symfony\Component\Serializer\Encoder\JsonEncoder implements DecoderInterface, EncoderInterface
- class \Drupal\serialization\Encoder\JsonEncoder implements DecoderInterface, EncoderInterface
Expanded class hierarchy of JsonEncoder
1 file declares its use of JsonEncoder
- JsonEncoderTest.php in core/
modules/ serialization/ tests/ src/ Unit/ Encoder/ JsonEncoderTest.php - Contains \Drupal\Tests\serialization\Unit\Encoder\JsonEncoderTest.
1 string reference to 'JsonEncoder'
- serialization.services.yml in core/
modules/ serialization/ serialization.services.yml - core/modules/serialization/serialization.services.yml
1 service uses JsonEncoder
- serializer.encoder.json in core/
modules/ serialization/ serialization.services.yml - Drupal\serialization\Encoder\JsonEncoder
File
- core/
modules/ serialization/ src/ Encoder/ JsonEncoder.php, line 17 - Contains \Drupal\serialization\Encoder\JsonEncoder.
Namespace
Drupal\serialization\EncoderView source
class JsonEncoder extends BaseJsonEncoder implements EncoderInterface, DecoderInterface {
/**
* The formats that this Encoder supports.
*
* @var array
*/
protected static $format = array(
'json',
'ajax',
);
/**
* {@inheritdoc}
*/
public function supportsEncoding($format) {
return in_array($format, static::$format);
}
/**
* {@inheritdoc}
*/
public function supportsDecoding($format) {
return in_array($format, static::$format);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JsonEncoder:: |
protected | property | ||
JsonEncoder:: |
protected | property | ||
JsonEncoder:: |
protected static | 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 |