class ContentHubCdfEncoder in Acquia Content Hub 8
Encodes Content Hub CDF data in JSON.
Simply respond to the acquia_contenthub_cdf format requests using the JSON encoder.
Hierarchy
- class \Drupal\acquia_contenthub\Encoder\ContentHubCdfEncoder extends \Symfony\Component\Serializer\Encoder\JsonEncoder
Expanded class hierarchy of ContentHubCdfEncoder
1 file declares its use of ContentHubCdfEncoder
- ContentHubCdfEncoderTest.php in tests/
src/ Unit/ Encoder/ ContentHubCdfEncoderTest.php
1 string reference to 'ContentHubCdfEncoder'
1 service uses ContentHubCdfEncoder
File
- src/
Encoder/ ContentHubCdfEncoder.php, line 13
Namespace
Drupal\acquia_contenthub\EncoderView source
class ContentHubCdfEncoder extends SymfonyJsonEncoder {
/**
* The formats that this Encoder supports.
*
* @var string
*/
protected $format = 'acquia_contenthub_cdf';
/**
* {@inheritdoc}
*/
public function supportsEncoding($format) {
return $format == $this->format;
}
/**
* {@inheritdoc}
*/
public function supportsDecoding($format) {
return $format == $this->format;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentHubCdfEncoder:: |
protected | property | The formats that this Encoder supports. | |
ContentHubCdfEncoder:: |
public | function | Checks whether the deserializer can decode from given format. | |
ContentHubCdfEncoder:: |
public | function | Checks whether the serializer can encode to given format. |