\DMSDocumentCart
Class DMSDocumentCart represents the shopping cart.
Synopsis
class DMSDocumentCart
extends ViewableData
{
- // methods
- public void __construct()
- public ArrayList getItems()
- public string getCartSummaryCacheKey()
- public DMSDocumentCart addItem()
- public DMSRequestItem|boolean getItem()
- public DMSDocumentCart removeItem()
- public DMSDocumentCart removeItemByID()
- public DMSDocumentCart updateItemQuantity()
- public DMSDocumentCart emptyCart()
- public boolean isCartEmpty()
- public DMSDocumentCart setBackUrl()
- public string getBackUrl()
- public DMSDocumentCart setReceiverInfo()
- public array getReceiverInfo()
- public ArrayData|bool getReceiverInfoNice()
- public DMSSessionBackend getBackend()
- public bool isInCart()
- public int saveSubmission()
- public bool isViewOnly()
- public DMSDocumentCart setViewOnly()
- public HTMLText getSummary()
- public string getLink()
Hierarchy
Extends
- ViewableData
Members
private
- $viewOnly
—
bool
Variable to control whether a cart is being updated or not
protected
- $backend
—
DMSCartBackendInterface
A handle to the classes' {@link DMSCartBackendInterface}
Methods
public
- __construct() — Instantiate a cart backend either by that provided, or a session default
- addItem() — Add an {@link DMSRequestItem} object into the cart.
- emptyCart() — Completely empties a cart
- getBackUrl() — Returns the backURL for the current Document Cart
- getBackend() — Gets the backend handler
- getCartSummaryCacheKey() — Gets a partial caching key that can be used to prevent the getItems method from hitting the database every time to check whether a document exists. Includes a hash of the valid items in the cart (including their quantity).
- getItem() — Get a {@link DMSRequestItem} object from the cart.
- getItems() — Returns all the cart items as an array
- getLink() — Utility method to link to the current controllers action
- getReceiverInfo() — Retrieves the recipients info as an array (e.g. array('Name'=>'Joe','Surname'=>'Soap'))
- getReceiverInfoNice() — Returns the recipients in a Viewable format
- getSummary() — Displays a view-only table of the cart items.
- isCartEmpty() — Checks if a cart is empty.
- isInCart() — Checks if an item exists within a cart. Returns true (if exists) or false.
- isViewOnly() — Returns true if the cart is being updated. False otherwise
- removeItem() — Removes a {@link DMSRequestItem} from the cart by it's id
- removeItemByID() — Removes a {@link DMSRequestItem} from the cart by it's id
- saveSubmission() — Persists a cart submission to the database
- setBackUrl() — Set the backURL to be a Session variable for the current Document Cart
- setReceiverInfo() — Sets the recipients info as an array (e.g. array('Name'=>'Joe','Surname'=>'Soap'))
- setViewOnly() — Sets the updating flag
- updateItemQuantity() — Adjusts (increments, decrements or amends) the quantity of an {@link DMSRequestItem}.' A positive $quantity increments the total, whereas a negative value decrements the total. A cart item is removed completely if it's value reaches <= 0.