Phundament-Packages
[ class tree: Phundament-Packages ] [ index: Phundament-Packages ] [ all elements ]

Source for file LCreoleRow.php

Documentation is available at LCreoleRow.php

  1. <?php
  2.  
  3. /**
  4.  * LCreoleRow class file.
  5.  *
  6.  * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  7.  * @copyright 2005, diemeisterei GmbH. All rights reserved.
  8.  * @author $Author: schmunk $
  9.  * @version $Revision: 601 $  $Date: 2007-02-24 23:49:30 +0100 (Sa, 24 Feb 2007) $
  10.  * @package Phundament.Packages
  11.  * @subpackage LDatabase
  12.  */
  13.  
  14. /**
  15.  * A propel-a-like object for consistent code. This object is read-only!
  16.  * Note: Use propel when editing
  17.  *
  18.  * @package System.Data
  19.  */
  20. class LCreoleRow
  21. {
  22.     private $_row;
  23.  
  24.     /**
  25.     * Initializes variables
  26.     */
  27.     function __construct($row)
  28.     {
  29.         $this->_row $row;
  30.     }
  31.  
  32.     /**
  33.     * Magic getter function
  34.     */
  35.     function __get($value)
  36.     {
  37.         if (isset ($this->_row[$value]))
  38.         {
  39.             $return $this->_row[$value];
  40.         else
  41.         {
  42.             $eval "return \$this->get".$value."();";
  43.             $return = eval ($eval);
  44.         }
  45.         return $return;
  46.     }
  47.     /**
  48.      * Simulates propel getter functions
  49.      */
  50.     function __call($func$param)
  51.     {
  52.         if (substr($func03== "get")
  53.         {
  54.             $name substr($func3);
  55.             $key strtolower($name[0]);
  56.             for ($c 1$c strlen($name)$c ++)
  57.             {
  58.                 $char $name[$c];
  59.                 if ((strcmp(strtoupper($char)$char== && !is_numeric($char)) true false)
  60.                     $key .= "_".strtolower($char);
  61.                 else
  62.                     $key .= strtolower($char);
  63.  
  64.             }
  65.             $return $this->_row[$key];
  66.         }
  67.         return $return;
  68.     }
  69.  
  70. }
  71. ?>

Documentation generated on Sun, 25 Feb 2007 16:10:05 +0100 by phpDocumentor 1.3.1