cvs: pear /Structures_DataGrid/DataGrid/DataSource DataObject.php

From: Date: Fri, 11 Mar 2005 22:52:13 +0000
Subject: cvs: pear /Structures_DataGrid/DataGrid/DataSource DataObject.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-30224@lists.php.net to get a copy of this message
asnagy Fri Mar 11 17:52:13 2005 EDT Modified files: /pear/Structures_DataGrid/DataGrid/DataSource DataObject.php Log: Fixed get method calling (Bug 3769) http://cvs.php.net/diff.php/pear/Structures_DataGrid/DataGrid/DataSource/DataObject.php?r1=1.18&r2=1.19&ty=u Index: pear/Structures_DataGrid/DataGrid/DataSource/DataObject.php diff -u pear/Structures_DataGrid/DataGrid/DataSource/DataObject.php:1.18 pear/Structures_DataGrid/DataGrid/DataSource/DataObject.php:1.19 --- pear/Structures_DataGrid/DataGrid/DataSource/DataObject.php:1.18 Mon Jan 24 10:55:19 2005 +++ pear/Structures_DataGrid/DataGrid/DataSource/DataObject.php Fri Mar 11 17:52:13 2005 @@ -17,7 +17,7 @@ // | Andrew Nagy <asnagy@webitecture.org> | // +----------------------------------------------------------------------+ // -// $Id: DataObject.php,v 1.18 2005/01/24 15:55:19 asnagy Exp $ +// $Id: DataObject.php,v 1.19 2005/03/11 22:52:13 asnagy Exp $ require_once 'Structures/DataGrid/DataSource.php'; @@ -38,7 +38,7 @@ * same kind of information as the "fields" options. If the "fields" * option is set, this one will not be used. Default : "fb_fieldsToRender". * - * @version $Revision: 1.18 $ + * @version $Revision: 1.19 $ * @author Olivier Guilyardi <olivier@samalyse.com> * @author Andrew Nagy <asnagy@webitecture.org> * @access public @@ -77,6 +77,7 @@ { parent::Structures_DataGrid_DataSource(); $this->_addDefaultOptions(array( + 'use_private_vars' => false, 'labels_property' => 'fb_fieldLabels', 'fields_property' => 'fb_fieldsToRender', 'sort_property' => 'fb_linkOrderFields', @@ -207,9 +208,15 @@ while ($this->_dataobject->fetch()) { // Determine Fields if (!$this->_options['fields']) { - $this->_options['fields'] = - array_keys($this->_dataobject->toArray()); - //$this->_options['fields'] = array_filter(array_keys(get_object_vars($this->_dataobject)), array(&$this, '_fieldsFilter')); + if ($this->options['use_private_vars']) { + $this->_options['fields'] = + array_keys(get_object_vars($this->_dataobject)); + } else { + $this->_options['fields'] = + array_keys($this->_dataobject->toArray()); + } + //$this->_options['fields'] = + // array_filter(array_keys(get_object_vars($this->_dataobject)), array(&$this, '_fieldsFilter')); } $fieldList = $this->_options['fields']; // Build DataSet @@ -218,7 +225,7 @@ $getMethod = 'get'.$fName; if (method_exists($this->_dataobject, $getMethod)) { //$rec[$fName] = $this->_dataobject->$getMethod(&$this); - $rec[$fName] = $this->_dataobject->$getMethod; + $rec[$fName] = $this->_dataobject->$getMethod(); } elseif (isset($this->_dataobject->$fName)) { $rec[$fName] = $this->_dataobject->$fName; } else { @@ -262,7 +269,7 @@ $this->_rowNum = $test; } } - + return $this->_rowNum; } @@ -299,4 +306,4 @@ } } -?> \ No newline at end of file +?>

« previous php.pear.cvs (#30224) next »