Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • SessionCart
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class SessionCart

Shopping cart session wrapper

SessionCart uses Blesta\Core\Util\Common\Traits\Container
Package: blesta\components\session\cart
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/session_cart/session_cart.php
Methods summary
public
# __construct( integer $cart_name, Minphp\Session\Session $session )

Initializes the session cart

Initializes the session cart

Parameters

$cart_name
The name of the cart to use in the session
$session
session object
public
# setCallback( string $action, callable $callback )

Sets a callback to be invoked when the given $method is called.

Sets a callback to be invoked when the given $method is called.

Parameters

$action
The action to invoke the callback on (supported actions: addItem, updateItem, removeItem)
$callback
callback to execute
public array
# get( )

Returns the cart

Returns the cart

Returns

array
An array of cart info including 'items' and any thing else set for the cart
public
# emptyCart( )

Empties the cart by removing all items from it

Empties the cart by removing all items from it

public
# clear( )

Clears the cart entirely

Clears the cart entirely

public mixed
# getItem( integer $index )

Returns an item in the cart at the given index

Returns an item in the cart at the given index

Parameters

$index
The index of the item to return

Returns

mixed
The item or null otherwise
public integer
# addItem( mixed $item )

Adds an item to the cart

Adds an item to the cart

Parameters

$item
The item to add to the cart

Returns

integer
The index the item was added to
public
# updateItem( integer $index, mixed $item )

Update an item in the cart

Update an item in the cart

Parameters

$index
The index to update
$item
The item to update at the given index
public
# removeItems( array $indexes )

Removes a set of items from the cart

Removes a set of items from the cart

Parameters

$indexes
A list of indexes matching the cart item indexes for items to remove
public mixed
# removeItem( integer $index )

Remove an item from the cart

Remove an item from the cart

Parameters

$index
The index of the item to remove from the cart

Returns

mixed
The item removed or null otherwise
public mixed
# prequeueItem( mixed $item )

Allows an item to be modified before it is added to the cart

Allows an item to be modified before it is added to the cart

Parameters

$item
An item to add to the queue

Returns

mixed
Update $item content based on any triggered events
public integer
# enqueue( mixed $item )

Adds an item to the queue

Adds an item to the queue

Parameters

$item
An item to add to the queue

Returns

integer
The index of the queued item
public mixed
# dequeue( integer $index = 0 )

Removes and returns the first item from the queue

Removes and returns the first item from the queue

Parameters

$index
The index to dequeue

Returns

mixed
An item from the queue, null if no items exist
public mixed
# checkQueue( integer $index = 0 )

Returns the first item from the queue without removing it

Returns the first item from the queue without removing it

Parameters

$index
The index to peek at

Returns

mixed
An item from the queue, null if no items exist
public boolean
# isEmptyQueue( )

Returns whether or not the queue is empty

Returns whether or not the queue is empty

Returns

boolean
true if the queue is empty, false otherwise
public boolean
# isEmptyCart( )

Returns whether or not the cart is empty

Returns whether or not the cart is empty

Returns

boolean
true if the cart is empty, false otherwise
public
# setData( string $field, mixed $value )

Sets a specified field into the cart with the given value

Sets a specified field into the cart with the given value

Parameters

$field
The field key to set to the session
$value
The value to save to the cart for the field
public mixed
# getData( string $field )

Returns a specified field from the cart

Returns a specified field from the cart

Parameters

$field
The field name to fetch

Returns

mixed
The value stored in the cart at $field
Methods used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Blesta API documentation generated by ApiGen