DataObject_FormBuilder conditions
| From: | James Stewart | Date: | Fri, 04 Feb 2005 16:21:40 +0000 |
| Subject: | DataObject_FormBuilder conditions | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17389@lists.php.net to get a copy of this message | ||
I've just started using FormBuilder and am using it for a file upload system. I want to allow a user to upload files for any of their clients. What I'd like to produce is a select box with a list of just this user's clients.
Using this code and the relevant changes in the DO class, I have a select box with all the users appearing, but I had hoped the whereAdd would limit it?
$users = DB_DataObject::factory('users');
$file = DB_DataObject::factory('files');
$file->joinAdd($users);
$file->whereAdd("users.user_parent = $parent_value");
$build =& DB_DataObject_FormBuilder::create($file);
$this->form = $build->getForm();
I can't seem to find anything in the docs about this. Is there a straightforward way to do what I want?
thanks. James.