Changeset 468 for trunk/lib/Cart.inc.php


Ignore:
Timestamp:
Feb 20, 2014 3:03:59 AM (10 years ago)
Author:
anonymous
Message:

Completed integrating /branches/eli_branch into /trunk. Changes include:

  • Removed closing ?> from end of files
  • Upgrade old-style contructor methods to use construct() instead.
  • Class properties and methods defined as public, private, static or protected
  • Ensure code runs under E_ALL with only mysql_* deprecated warnings
  • Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
  • Run the php cli -l option to check files for syntax errors.
  • Bring tests up-to-date with latest version and methods of PHPUnit
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lib/Cart.inc.php

    r396 r468  
    7171
    7272    // Namespace of this instance.
    73     var $_ns;
     73    private $_ns;
    7474
    7575    // Configuration parameters for this object.
    76     var $_params = array(
     76    private $_params = array(
    7777    );
    7878
     
    8080     * Cart constructor.
    8181     */
    82     function Cart($namespace='')
     82    public function __construct($namespace='')
    8383    {
    8484        $app =& App::getInstance();
     
    9797     * @param  array $params   Array of param keys and values to set.
    9898     */
    99     function setParam($params=null)
     99    public function setParam($params=null)
    100100    {
    101101        if (isset($params) && is_array($params)) {
     
    112112     * @return mixed               Configured parameter value.
    113113     */
    114     function getParam($param)
     114    public function getParam($param)
    115115    {
    116116        $app =& App::getInstance();
     
    137137    * @since    11 Mar 2008 18:59:37
    138138    */
    139     function add($item_id, $price, $quantity=1, $specs=array())
     139    public function add($item_id, $price, $quantity=1, $specs=array())
    140140    {
    141141        $app =& App::getInstance();
     
    166166    * @since    10 May 2008 16:42:25
    167167    */
    168     function setQty($item_id, $quantity)
     168    public function setQty($item_id, $quantity)
    169169    {
    170170        if ($quantity <= 0) {
     
    195195    * @since    10 May 2008 16:42:25
    196196    */
    197     function setPrice($item_id, $price)
     197    public function setPrice($item_id, $price)
    198198    {
    199199        if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id])) {
     
    218218    * @since    11 Mar 2008 18:59:48
    219219    */
    220     function remove($item_id)
     220    public function remove($item_id)
    221221    {
    222222        $app =& App::getInstance();
     
    242242    * @since    11 Mar 2008 18:59:55
    243243    */
    244     function get($item_id, $spec_key)
     244    public function get($item_id, $spec_key)
    245245    {
    246246        if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id][$spec_key])) {
     
    259259    * @since    11 Mar 2008 18:59:55
    260260    */
    261     function getList()
     261    public function getList()
    262262    {
    263263        return $_SESSION['_cart'][$this->_ns]['items'];
     
    277277    * @since    11 Mar 2008 19:00:12
    278278    */
    279     function sum($key='extended_price')
     279    public function sum($key='extended_price')
    280280    {
    281281        $sum = 0;
     
    306306     * as $auth->clear(), such as when logging out.
    307307     */
    308     function clear()
     308    public function clear()
    309309    {
    310310        $_SESSION['_cart'][$this->_ns] = array(
     
    313313    }
    314314}
    315 
    316 
    317 ?>
Note: See TracChangeset for help on using the changeset viewer.