You are here

interface SerializationInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/Serialization/SerializationInterface.php \Drupal\Component\Serialization\SerializationInterface

Defines an interface for serialization formats.

Hierarchy

Expanded class hierarchy of SerializationInterface

All classes that implement SerializationInterface

4 files declare their use of SerializationInterface
DatabaseStorage.php in core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php
Contains \Drupal\Core\KeyValueStore\DatabaseStorage.
DatabaseStorageExpirable.php in core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
Contains \Drupal\Core\KeyValueStore\DatabaseStorageExpirable.
KeyValueDatabaseExpirableFactory.php in core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
Contains \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory.
KeyValueDatabaseFactory.php in core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php
Contains \Drupal\Core\KeyValueStore\KeyValueDatabaseFactory.

File

core/lib/Drupal/Component/Serialization/SerializationInterface.php, line 13
Contains \Drupal\Component\Serialization\SerializationInterface.

Namespace

Drupal\Component\Serialization
View source
interface SerializationInterface {

  /**
   * Encodes data into the serialization format.
   *
   * @param mixed $data
   *   The data to encode.
   *
   * @return string
   *   The encoded data.
   */
  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.
   */
  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

Namesort descending Modifiers Type Description Overrides
SerializationInterface::decode public static function Decodes data from the serialization format. 3
SerializationInterface::encode public static function Encodes data into the serialization format. 3
SerializationInterface::getFileExtension public static function Gets the file extension for this serialization format. 3