Wiki - Configuring dataobject_formbuilder
| From: | Michel D'HOOGE | Date: | Thu, 01 Jun 2006 07:03:54 +0000 |
| Subject: | Wiki - Configuring dataobject_formbuilder | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-24216@lists.php.net to get a copy of this message | ||
Hello
I just read the wiki page on configuring DB_FB and wonder if the first
example is correct...
http://pear.reversefold.com/dokuwiki/doku.php?id=pear:db_dataobject_formbuilder:configuring_formbuilder
It is written there that the first method to configure FB is "by setting
member variables in an extended class". Then all the other described
methods should be able to override these settings. However the constructor
is defined as follows:
function DB_DataObject_FormBuilder_MyDriver(&$do, $options = false) {
parent::DB_DataObject_FormBuilder($do, $options);
$this->linkDispayLevel = 2;
$this->elementTypeMap['date'] = 'myDate';
}
And thus the child class modifies the variables once the parent constructor
returns, cancelling any modifications. According to me, the constructor
should look like:
function DB_DataObject_FormBuilder_MyDriver(&$do, $options = false) {
$this->linkDispayLevel = 2;
$this->elementTypeMap['date'] = 'myDate';
parent::DB_DataObject_FormBuilder($do, $options);
}
Any comment?
Michel