DB_DataObject_FormBuilder: reorderElements, preDefOrder
| From: | Mocsnik Norbert | Date: | Thu, 06 Nov 2003 23:50:54 +0000 |
| Subject: | DB_DataObject_FormBuilder: reorderElements, preDefOrder | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-23312@lists.php.net to get a copy of this message | ||
Is there a reason to check if preDefOrder contains as many fields as the DataObject itself does? If this check is left out, it is possible to use this variable for indicating which fields to render, instead of implementing one more variable ("fields_to_display") in the future.
function _reorderElements() {
if(isset($this->_do->preDefOrder)
&& is_array($this->_do->preDefOrder)
&& count($this->_do->preDefOrder)== count($this->_do->table())) {
..
In short, if I have 10 fields and I do
$do->preDefOrder = array('firstfield', 'secondfield');
then I'm sure I want to display only these fields and I did not write it wrong.
Norbert Mocsnik