PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #5656

toValue( boolean_column ) not works

Details

Submitted2005-10-11 14:29 UTC
Fromxia at silvia dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version4.3.11
Roadmaps(Not assigned)

Comments

[2005-10-11 14:29 UTC] xia at silvia dot com

Description:
------------
toValue() method with boolean column name does not work.

First, const "DB_DATAOBJECT_BOOLEAN" used in switch() statement, but declared const is "DB_DATAOBJECT_BOOL".

And, method returns $cols[$col] but $this->$col.

This part of method should be as:

----
case ($cols[$col] & DB_DATAOBJECT_BOOL):

if ($cols[$col] & DB_DATAOBJECT_STR) {
// it's a 't'/'f' !
return ($this->$col == 't');
}
return (bool) $this->$col;
----

[2005-10-12 02:21 UTC] xia at silvia dot com

Thanks, but, there were another bug.
Method returns $cols[$col] now, but should return (bool)$this->$col or ($this->$col == 't').
Please fix it.

And, I found one more, 'default' returns $this->col, but it should return $this->$col. Should I report it as new bug?