Skip to content

development adjusments

Tim Stair edited this page Mar 18, 2018 · 2 revisions

SAMQ Development: Adjustments

PHP Session

The PHP session ($_SESSION) is used to persist information across requests. Learn more about the PHP Session.

Store

By default the result of adjustments are stored in _SESSION['default'] but you can specify the store you wish to adjust values in.

Example

Adjustment::with('gold_key', 1);

This would make a change so the _SESSION['default']['gold_key'] variable has a value of 1.

Timing

An adjustment is performed when the necessary conditions have been met. This is always contextual based on how you have things setup.

Adjustments on InputRequests

  • Before an InputRequest is rendered
  • After an InputRequest is rendered

Adjustments on Responses

  • When a Response is selected (before it transitions to the next request)

Adjustment Types

With the exception of the ClearSessionAdjustment, all the others support the specification of the store to operate with.

Adjusment

This is the standard Adjusment. It changes or creates a new value.

Increment

An IncrementAdjustment creates or increments an existing value.

Clear All

The ClearAllAdjustment is used to wipe an entire store within the session.

Clear Session

The ClearSessionAdjusment wipes the entire session using session_unset.

Clone this wiki locally