Reputation: 2629
Using sfguard and doctrine I have the following groups:
Managers Chefs Waiters
I have a module for receipts and in the form I want to select a waiter. The default ReceiptForm.class.php populates the fields:
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'sf_guard_user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('sfGuardUser'), 'add_empty' => true)),
);
Its fine as it grabs all the users but how do I configure it to only have users from the group "waiters" or id=3 in the database?
Upvotes: 0
Views: 183
Reputation: 1279
You can pass a Doctrine_Query object to the widget with the query
option as explained in Chapter 10 - Forms for Propel. It' the same thing using Doctrine.
Upvotes: 1