- <?php
-
- /**
- * LCreoleRow class file.
- *
- * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
- * @copyright 2005, diemeisterei GmbH. All rights reserved.
- * @author $Author: schmunk $
- * @version $Revision: 188 $ $Date: 2006-05-11 10:50:16 +0200 (Do, 11 Mai 2006) $
- * @package Lithron.LDatabase
- * @subpackage Support
- */
-
- /**
- * A propel-a-like object for consistent code. This object is read-only!
- * Note: Use propel when editing
- *
- * @package Lithron.LDatabase
- * @subpackage Support
- */
- class LCreoleRow
- {
- private $_row;
-
- /**
- * Initializes variables
- */
- function __construct($row)
- {
- $this->_row = $row;
- }
-
- /**
- * Magic getter function
- */
- function __get($value)
- {
- if (isset ($this->_row[$value]))
- {
- $return = $this->_row[$value];
- } else
- {
- $eval = "return \$this->get".$value."();";
- $return = eval ($eval);
- }
- return $return;
- }
- /**
- * Simulates propel getter functions
- */
- function __call($func, $param)
- {
- if (substr($func, 0, 3) == "get")
- {
- $name = substr($func, 3);
- $key = strtolower($name[0]);
- for ($c = 1; $c < strlen($name); $c ++)
- {
- $char = $name[$c];
- if ((strcmp(strtoupper($char), $char) == 0 && !is_numeric($char)) ? true : false)
- $key .= "_".strtolower($char);
- else
- $key .= strtolower($char);
-
- }
- #echo "OK($key)";
- $return = $this->_row[$key];
- }
- return $return;
- }
-
- }
- ?>