interface SerializationInterface in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Serialization/SerializationInterface.php \Drupal\Component\Serialization\SerializationInterface
Defines an interface for serialization formats.
Hierarchy
- interface \Drupal\Component\Serialization\SerializationInterface
Expanded class hierarchy of SerializationInterface
All classes that implement SerializationInterface
7 files declare their use of SerializationInterface
- DatabaseStorage.php in core/
lib/ Drupal/ Core/ KeyValueStore/ DatabaseStorage.php - DatabaseStorageExpirable.php in core/
lib/ Drupal/ Core/ KeyValueStore/ DatabaseStorageExpirable.php - FrontMatter.php in core/
lib/ Drupal/ Component/ FrontMatter/ FrontMatter.php - KeyValueDatabaseExpirableFactory.php in core/
lib/ Drupal/ Core/ KeyValueStore/ KeyValueDatabaseExpirableFactory.php - KeyValueDatabaseFactory.php in core/
lib/ Drupal/ Core/ KeyValueStore/ KeyValueDatabaseFactory.php
File
- core/
lib/ Drupal/ Component/ Serialization/ SerializationInterface.php, line 8
Namespace
Drupal\Component\SerializationView source
interface SerializationInterface {
/**
* Encodes data into the serialization format.
*
* @param mixed $data
* The data to encode.
*
* @return string
* The encoded data.
*
* @throws \Drupal\Component\Serialization\Exception\InvalidDataTypeException
*/
public static function encode($data);
/**
* Decodes data from the serialization format.
*
* @param string $raw
* The raw data string to decode.
*
* @return mixed
* The decoded data.
*
* @throws \Drupal\Component\Serialization\Exception\InvalidDataTypeException
*/
public static function decode($raw);
/**
* Gets the file extension for this serialization format.
*
* @return string
* The file extension, without leading dot.
*/
public static function getFileExtension();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SerializationInterface:: |
public static | function | Decodes data from the serialization format. | 7 |
SerializationInterface:: |
public static | function | Encodes data into the serialization format. | 7 |
SerializationInterface:: |
public static | function | Gets the file extension for this serialization format. | 7 |