Slashblog
[ class tree: Slashblog ] [ index: Slashblog ] [ all elements ]

Source for file dataitem.class.php

Documentation is available at dataitem.class.php

  1. <?php
  2. /**
  3.  * This class represents a data item, i.e. a value, represented by a key to identify it. It acts more like a struct than a class, in the way that it's only meant to store data, not manipulate it.
  4.  * 
  5.  * @author Daniel Nordstrom <dnordstrom@mankindorganization.com>
  6.  * @link www.mrnordstrom.com
  7.  */
  8.  
  9. class DataItem {
  10.     
  11.     private $key;
  12.     private $value;
  13.     
  14.     /**
  15.      * Constructor.
  16.      * 
  17.      * @param string $k Key.
  18.      * @param string $v Value to associate to key.
  19.      */
  20.     function __construct($k ""$v ""
  21.     {
  22.         $this->key $k;
  23.         $this->value $v;
  24.     }
  25.     
  26.     /**
  27.      * GetKey()
  28.      * 
  29.      * Returns key.
  30.      * 
  31.      * @return string Key representing the item.
  32.      */
  33.     public function GetKey()
  34.     {
  35.         return $this->key;
  36.     }
  37.     
  38.     /**
  39.      * GetValue()
  40.      * 
  41.      * Returns value.
  42.      * 
  43.      * @return string Value of item.
  44.      */
  45.     public function GetValue()
  46.     {
  47.         return $this->value;
  48.     }
  49.     
  50.     /**
  51.      * GetValue()
  52.      * 
  53.      * Sets value.
  54.      * 
  55.      * @param string New value.
  56.      */
  57.     public function SetValue($value)
  58.     {
  59.         $this->value $value;
  60.     }
  61. }
  62.  
  63. ?>

Documentation generated on Mon, 26 May 2008 19:59:42 +0100 by phpDocumentor 1.4.0