Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #4019 Redeclaration of members with a different case
Submitted: 2005-03-31 16:53 UTC
From: thierry dot daguin at cram-bretagne dot fr Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: 5.0.3 OS: W2K
Roadmaps: (Not assigned)    
Subscription  


 [2005-03-31 16:53 UTC] thierry dot daguin at cram-bretagne dot fr
Description: ------------ PEAR::DB_Dataobjects 1.7.10 Database type : OCI8 The class is defined with members in capital letter. After a find(), members are duplicated in small letter and contain the data. The data should be in members in capital letter and no small letter members shoud be added. Reproduce code: --------------- My class : class DataObjects_BG extends DB_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ public $__table = 'BG'; //table name public $NUM; // NUMBER(22) public $DT; // DATE(7) /* Static get */ ... } My code: $bg = new DataObjects_BG; $bg->NUM = '1'; $number_of_rows = $bg->find(true); print_r($bg); Expected result: ---------------- DataObjects_BG Object ( [__table] => BG [NUM] => 1 [DT] => 14/06/03 [_DB_DataObject_version] => @version@ [N] => 1 [_database_dsn] => [_database_dsn_md5] => 500c396c73690c616c77d6a89d55f7b5 [_database] => dsred1 [_DB_resultid] => 1 [_link_loaded] => [_join] => [_lastError] => [_query] => Array ( [condition] => [group_by] => [order_by] => [having] => [limit_start] => [limit_count] => [data_select] => * ) ) Actual result: -------------- DataObjects_BG Object ( [__table] => BG [NUM] => 1 [DT] => [_DB_DataObject_version] => @version@ [N] => 1 [_database_dsn] => [_database_dsn_md5] => 500c396c73690c616c77d6a89d55f7b5 [_database] => dsred1 [_DB_resultid] => 1 [_link_loaded] => [_join] => [_lastError] => [num] => 1 [dt] => 14/06/03 [_query] => Array ( [condition] => [group_by] => [order_by] => [having] => [limit_start] => [limit_count] => [data_select] => * ) )

Comments

 [2005-04-04 02:01 UTC] alan_k
try adding the DB compatibility option (I think it's mentioned in the options), this should lowercase everything.
 [2005-04-04 12:09 UTC] thierry dot daguin at cram-bretagne dot fr
Hello Alan, I assume you're talking of portability option that must be set to 15 when using with oracle. That's what i did when creating table object and when using it but it doesn't work. It seems that this option is not used : - not read from ini file in createTables.php - not set on database connection in dataobject.php (line 2039). If i add this line ($db_options['portability'] = 15;), members are well generated with lowercase. Regards.
 [2005-04-15 14:52 UTC] thierry dot daguin at cram-bretagne dot fr
I think i have found what was wrong. I replaced in createTables.php the lines 41 and 42 : $options = &PEAR::getStaticProperty('DB_DataObject','options'); $options = $config['DB_DataObject']; with foreach($config as $class=>$values) { $options = &PEAR::getStaticProperty($class,'options'); $options = $values; } Could you verify this ? Thanks
 [2005-04-16 00:35 UTC] alan_k
Yeap that needs fixing.
 [2005-04-20 07:44 UTC] alan_k
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.