PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject_FormBuilder » Bug #477

Call set{field} in processForm if existing

Details

Submitted2003-12-22 15:02 UTC
Fromblokkie at zonnet dot nl
Assignedmw21st
StatusClosed
PackageDB_DataObject_FormBuilder
PHP Version4.3.4
OSWindows XP
Roadmaps(Not assigned)

Comments

[2003-12-22 15:02 UTC] blokkie at zonnet dot nl

Description:
------------
If the form is processed, it might be handy to call the set{field} function in the DB_DataObject, if one is existing. I used it to convert a password to md5(password).

Reproduce code:
---------------
in version 1.20 change:

$this->_do->$field = $value;

in

if (method_exists($this->_do, 'set' . $field)) {
$this->_do->{'set'.$field}($value);
} else {
$this->_do->$field = $value;
}

[2003-12-30 23:56 UTC] mw21st at php dot net

Yo blokkie,

thanks for posting this - it's a good idea in general, but I think this is already a built-in feature of DB_DataObject, at least if the Overload extension is activated:

http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.settersgetters.php

I've put your code in for the time being, but I'll check back with Alan if your solution could lead to conflicts. If not, it will stay in.

CU
Markus

[2003-12-31 00:19 UTC] mw21st at php dot net

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.