class SerializationTestEncoder in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/serialization/tests/serialization_test/src/SerializationTestEncoder.php \Drupal\serialization_test\SerializationTestEncoder
Hierarchy
- class \Drupal\serialization_test\SerializationTestEncoder implements EncoderInterface
Expanded class hierarchy of SerializationTestEncoder
1 string reference to 'SerializationTestEncoder'
- serialization_test.services.yml in core/
modules/ serialization/ tests/ serialization_test/ serialization_test.services.yml - core/modules/serialization/tests/serialization_test/serialization_test.services.yml
1 service uses SerializationTestEncoder
- serializer.encoder.serialization_test in core/
modules/ serialization/ tests/ serialization_test/ serialization_test.services.yml - Drupal\serialization_test\SerializationTestEncoder
File
- core/
modules/ serialization/ tests/ serialization_test/ src/ SerializationTestEncoder.php, line 12 - Contains \Drupal\serialization_test\SerializationTestEncoder.
Namespace
Drupal\serialization_testView source
class SerializationTestEncoder implements EncoderInterface {
/**
* The format that this Encoder supports.
*
* @var string
*/
protected static $format = 'serialization_test';
/**
* {@inheritdoc}
*/
public function encode($data, $format, array $context = array()) {
// @see \Drupal\serialization_test\SerializationTestNormalizer::normalize().
return 'Normalized by ' . $data['normalized_by'] . ', Encoded by SerializationTestEncoder';
}
/**
* {@inheritdoc}
*/
public function supportsEncoding($format) {
return static::$format === $format;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SerializationTestEncoder:: |
protected static | property | The format that this Encoder supports. | |
SerializationTestEncoder:: |
public | function |
Encodes data into the given format. Overrides EncoderInterface:: |
|
SerializationTestEncoder:: |
public | function |
Checks whether the serializer can encode to given format. Overrides EncoderInterface:: |