Home » Database » DB_DataObject » Bug #4019
Redeclaration of members with a different case
Details
| 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) |
Comments
[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] => * ) )
[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