phramework doc
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Phramework
    • Authentication
    • Database
      • Operations
    • Exceptions
    • Extensions
    • Models
    • URIStrategy
    • Validate
    • Viewers

Classes

  • StepCallback
  • Translation

Class StepCallback

Namespace: Phramework\Extensions
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Located at Extensions/StepCallback.php

Methods summary

public
# addVariable( string $key, mixed $variable )

Add a valiable to callback variables, passed to callback as parameter

Add a valiable to callback variables, passed to callback as parameter

Parameters

$key
$variable
public
# add( string $step, function $callback )

Add a step callback

Add a step callback

Step callbacks, are callbacks that executed when the API reaches a certain step, multiple callbacks can be set for the same step.

Parameters

$step
$callback

Throws

Exception
When callback is not not callable
Phramework\Exceptions\IncorrectParametersException

Since

0.1.1
public boolean
# call( string $step, array & $params = null, string $method = null, array & $headers = null, $extra = [] )

Execute all callbacks set for this step The value of $params and $headers can be passed by reference so the callback functions can modify these variables

Execute all callbacks set for this step The value of $params and $headers can be passed by reference so the callback functions can modify these variables

Parameters

$step
$params
Request parameters
$method
Request method
$headers
Request headers
$extra

Returns

boolean
Returns false if no callbacks set for this step
public
# __construct( )

Initialize step callback extension

Initialize step callback extension

Constants summary

string STEP_BEFORE_AUTHENTICATION_CHECK

Callback passes $step, $params, $method, $headers, $callbackVariables

Callback passes $step, $params, $method, $headers, $callbackVariables

# 'STEP_BEFORE_AUTHENTICATION_CHECK'
string STEP_AFTER_AUTHENTICATION_CHECK

Callback passes $step, $params, $method, $headers, $callbackVariables

Callback passes $step, $params, $method, $headers, $callbackVariables

# 'STEP_AFTER_AUTHENTICATION_CHECK'
string STEP_BEFORE_CALL_URISTRATEGY

Called before URIStrategy invocation Callback passes $step, $params, $method, $headers, $callbackVariables

Called before URIStrategy invocation Callback passes $step, $params, $method, $headers, $callbackVariables

# 'STEP_BEFORE_CALL_URISTRATEGY'
string STEP_AFTER_CALL_URISTRATEGY

Called after URIStrategy invocation Callback passes $step, $params, $method, $headers, $callbackVariables, $invokedController, $invokedMethod

Called after URIStrategy invocation Callback passes $step, $params, $method, $headers, $callbackVariables, $invokedController, $invokedMethod

# 'STEP_AFTER_CALL_URISTRATEGY'
string STEP_BEFORE_CLOSE

Callback passes $step, $params, $method, $headers, $callbackVariables

Callback passes $step, $params, $method, $headers, $callbackVariables

# 'STEP_BEFORE_CLOSE'
string STEP_FINALLY

Callback passes $step, $params, $method, $headers, $callbackVariables

Callback passes $step, $params, $method, $headers, $callbackVariables

# 'STEP_FINALLY'
string STEP_ERROR

Called after exception is thrown Callback passes $step, $params, $method, $headers, $callbackVariables, $errors, $code, $exception

Called after exception is thrown Callback passes $step, $params, $method, $headers, $callbackVariables, $errors, $code, $exception

# 'STEP_ERROR'

Properties summary

protected array $stepCallback

Hold all step callbacks

Hold all step callbacks

#
protected $variables
#
phramework doc API documentation generated by ApiGen