\Shop_Order_Manager

Manages orders in different states and handles events on orders.

The order manager should manage orders in different states and handle events on orders. Each implementation could define its own states and events for orders. However all implementations should handle the following events:

  • create: to create a new order this event will be occured
  • update: to update an order this event will be occured
  • delete: to delete an order this event will be occured

Note: If 'secureId' is sets in the REQUEST parameters, then access MUST not be checked.

Summary

Methods
Constants
createOrderFilter()
apply()
transitions()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

createOrderFilter()

createOrderFilter(\Pluf_HTTP_Request  $request) : \Pluf_SQL

Creates an order filter

This filter is used to list orders based on states and the request. For example, all orders will be displayed to the owner of the system.

Parameters

\Pluf_HTTP_Request $request

Returns

\Pluf_SQL

apply()

apply(\Shop_Order  $order, String  $action, Boolean  $save = false) : \Shop_Order

Apply action on order

Each order must follow CRUD actions in life cycle. Here is default action list:

  • create
  • read
  • update
  • delete

Parameters

\Shop_Order $order
String $action
Boolean $save

to save or not the order

Returns

\Shop_Order

transitions()

transitions(\Shop_Order  $order) : array

Returns possible transitions for given order

Returns possible transitions respect to currecnt state of given order.

Parameters

\Shop_Order $order

Returns

array —

array of transitions