• PHP reference
  • Sandbox

Storage

class Sandbox\Storage extends ExtendableObject

Interface for the different data storage methods available in the Scholica Sandbox.

Methods

static Storage community(Community $community)

Get a new storage instance for a specific Community.

Parameters

Return Value

Collection collection($prefix)

Get access to a key-value collection with a specific $prefix.

Parameters

  • $prefix

Return Value

mixed|boolean keyvalue(string $key, mixed $value = null)

Get or set a value for a $key.

Parameters

  • string $key
  • mixed $value

Return Value

  • mixed|boolean

array|false keyvalue_list(string $query = '%', integer $limit = null, string $orderBy = null, integer $after = null)

List all keys that match $query.

Parameters

  • string $query
  • integer $limit
  • string $orderBy
  • integer $after

Return Value

  • array|false Associative array or false

mixed keyvalue_count(string $query = '%')

Get the number of key/value pairs that match a query.

Parameters

  • string $query

Return Value

  • mixed

boolean keyvalue_delete(string $key)

Delete a key/value pair.

Parameters

  • string $key

Return Value

  • boolean

Document upload(string $input_name = 'file')

Upload a file.

Parameters

  • string $input_name Name of the <input type="file"> element, defaults to file

Return Value

Document document(string $id)

Retrieve a file.

Parameters

  • string $id

Return Value

Inherited from ExtendableObject

__construct()

Constructor.

final static ExtendableObject instance()

Get instance.

Return Value

final static boolean hasInstance()

Check whether there is an instance of this class available.

Return Value

  • boolean

final boolean extension($extension)

Call class method, if it exists.

Parameters

  • $extension

Return Value

  • boolean