Detailed Description

An action key is a combination of a resource, context and action that is represented as a string.

ActionKey is a helper class for handling action keys.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 22 of file ActionKey.php.

Static Public Member Functions

static createKey ($resource, $context, $action)
 
static parseKey ($actionKey)
 
static getBestMatch (ActionKeyProvider $actionKeyProvider, $resource, $context, $action)
 

Member Function Documentation

◆ createKey()

static createKey (   $resource,
  $context,
  $action 
)
static

Create an action key from the given values.

Parameters
$resourceThe resource
$contextThe context
$actionThe action
Returns
String

Definition at line 33 of file ActionKey.php.

◆ parseKey()

static parseKey (   $actionKey)
static

Parse an action.

Parameters
$actionKeyThe action key
Returns
Associative array with keys 'resouce', 'context', 'action'

Definition at line 42 of file ActionKey.php.

◆ getBestMatch()

static getBestMatch ( ActionKeyProvider  $actionKeyProvider,
  $resource,
  $context,
  $action 
)
static

Get an action key that matches a given combination of resource, context, action best.

Parameters
$actionKeyProviderActionKeyProvider instance used to search action keys
$resourceThe given resource
$contextThe given context
$actionThe given action
Returns
The best matching key or an empty string if nothing matches.

Definition at line 55 of file ActionKey.php.