Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • SessionCart

Class SessionCart

Shopping cart session wrapper

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 )

Initializes the session cart

Initializes the session cart

Parameters

$cart_name
integer
$cart_name The name of the cart to use in the session
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
string
$action The action to invoke the callback on (supported actions: addItem, updateItem, removeItem)
$callback
callable
The 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
# clear( )

Clears the cart by removing all items from it

Clears the cart by removing all items from it

public integer
# addItem( mixed $item )

Adds an item to the cart

Adds an item to the cart

Parameters

$item
mixed
$item The item to add to the cart

Returns

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

Update an item in the cart

Update an item in the cart

public
# removeItems( array $indexes, mixed $remove_renewing_seats = false )

Removes a set of items from the cart

Removes a set of items from the cart

Parameters

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

Remove an item from the cart

Remove an item from the cart

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( mixed $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

public mixed
# getData( string $field )

Returns a specified field from the cart

Returns a specified field from the cart

Parameters

$field
string
$field The field name to fetch

Returns

mixed
The value stored in the cart at $field
private
# set( mixed $cart )

Set the cart

Set the cart

Magic methods summary

Properties summary

private string $cart_name
#

The name of the cart to use in the session

The name of the cart to use in the session

private array $callbacks
#

An array of callbacks in key/value pairs where each key is the name of the method to invoke the callback on

An array of callbacks in key/value pairs where each key is the name of the method to invoke the callback on

Blesta API documentation generated by ApiGen 2.8.0