Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

1498
 
1863
 
1863
 
object_info.php
_> 11 <?php
  22 /*
<> 3 -  $Id: object_info.php 1498 2007-03-29 14:04:50Z hpdl $
   3+  $Id: object_info.php 1863 2009-03-06 23:53:49Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
  77 
<> 8 -  Copyright (c) 2007 osCommerce
   8+  Copyright (c) 2009 osCommerce
99 
  1010   This program is free software; you can redistribute it and/or modify
  1111   it under the terms of the GNU General Public License v2 (1991)
  1212   as published by the Free Software Foundation.
  1313 */
  1414 
<>  15+/**
   16+ * The osC_ObjectInfo class wraps an object instance around an array data set
   17+ */
   18+
1519   class osC_ObjectInfo {
<> 16 -    var $_keys = array();
1720 
<> 18 -    function osC_ObjectInfo($array) {
  19 -      foreach ($array as $key => $value) {
  20 -        $this->_keys[$key] = $value;
  21 -      }
   21+/**
   22+ * Holds the array data set values
   23+ *
   24+ * @var array
   25+ * @access private
   26+ */
   27+
   28+    private $_data = array();
   29+
   30+/**
   31+ * Constructor, loads the array data set into the object instance
   32+ *
   33+ * @param array $data The array data set to insert into the object instance
   34+ * @access public
   35+ */
   36+
   37+    public function __construct($data) {
   38+      $this->_data = $data;
2239     }
  2340 
<> 24 -    function get($key) {
  25 -      return $this->_keys[$key];
   41+/**
   42+ * Get the value of a key element in the array data set
   43+ *
   44+ * @param string $key The name of the array key
   45+ * @access public
   46+ */
   47+
   48+    public function get($key) {
   49+      return $this->_data[$key];
2650     }
  2751 
<> 28 -    function getAll() {
  29 -      return $this->_keys;
   52+/**
   53+ * Get the value of a key element in the array data set and protect the output value
   54+ *
   55+ * @param string $key The name of the array key
   56+ * @access public
   57+ */
   58+
   59+    public function getProtected($key) {
   60+      return osc_output_string_protected($this->_data[$key]);
3061     }
<> 31 -     
  32 -    function set($key, $value) {
  33 -      $this->_keys[$key] = $value;
   62+
   63+/**
   64+ * Get the integer value of a key element in the array data set
   65+ *
   66+ * @param string $key The name of the array key
   67+ * @access public
   68+ */
   69+
   70+    public function getInt($key) {
   71+      return (int)$this->_data[$key];
3472     }
<>  73+
   74+/**
   75+ * Get the whole array data set
   76+ *
   77+ * @access public
   78+ */
   79+
   80+    public function getAll() {
   81+      return $this->_data;
   82+    }
   83+
   84+/**
   85+ * Set a value in the array data set
   86+ *
   87+ * @param string $key The name of the array key
   88+ * @param string $value The value of the array key
   89+ * @access public
   90+ */
   91+
   92+    public function set($key, $value) {
   93+      $this->_data[$key] = $value;
   94+    }
   95+
   96+/**
   97+ * Checks the existance of a key in the array data set
   98+ *
   99+ * @param string $key The name of the array key
   100+ * @access public
   101+ */
   102+
   103+    public function exists($key) {
   104+      return isset($this->_data[$key]);
   105+    }
<_ 35106   }
  36107 ?>