XMF Cookbook
  • Introduction
  • XMF Cookbook
  • Basic Ingredients
    • Namespaces
    • Autoloading
    • Debugging
    • Forward Compatibility
  • Recipes
    • Introducing Module Helpers
    • Using the Permission Helper
      • Checking Permissions
      • Managing Item Permissions
    • Using the Session Helper
    • Using JSON Web Tokens
    • Altering Database Tables
    • Migrating a Module's Database
    • Loading Initial Data
    • Module Admin Pages
      • Hide and Seek with Icons
      • Standard Admin Pages
    • Manage Metadata
    • Highlighting Content
  • Reference
    • Assert
      • Assertions
    • Database
      • Migrate
      • TableLoad
      • Tables
        • Getting Started
        • Table Operations
        • Working with Columns
        • Working with Indexes
        • Changing Table Data
        • Interacting with the Work Queue
        • Error Info and Debugging
    • Debug
    • FilterInput
    • Highlighter
    • IPAddress
    • Jwt
      • JsonWebToken
      • KeyFactory
      • TokenFactory
      • TokenReader
    • Key
      • ArrayStorage
      • Basic
      • FileStorage
      • KeyAbstract
      • StorageInterface
    • Language
    • Metagen
      • Extracting Data
      • Applying Data
    • Module
      • Admin
      • Helper
      • Helper
        • AbstractHelper
        • Cache
        • GenericHelper
        • Permission
        • Session
    • ProxyCheck
    • Random
    • Request
    • StopWords
    • Uuid
    • Yaml
  • Credits
  • License:
  • Table of Content
Powered by GitBook
On this page
  • save($name, $data)
  • fetch($name)
  • exists($name)
  • delete($name)
  1. Reference
  2. Key

StorageInterface

The Xmf\Key\StorageInterface interface defines the methods used to store and retrieve keys.

The key data is treated as string data. The actual Key class is responsible for any serialization or deserialization needed.

The $name parameter common to all methods is a string key name, the symbolic name of the key to use. The $name uniquely identifies the key in the key store. The key name should relate to a specific application action, or a closely related set of actions.

save($name, $data)

Save key data $data under the name $name.

Returns true if successful, otherwise false.

fetch($name)

Fetch key data stored under the name $name.

Returns the stored key data if successful, otherwise false.

exists($name)

Check for the existence of a key under the name $name.

Returns true if a key named $name exists, otherwise false.

delete($name)

Delete a any key stored under the name $name.

Returns true if successful, otherwise false.

PreviousKeyAbstractNextLanguage

Last updated 6 years ago