Hello... maybe it's to late but, did you find a solution to this
problem?
On 24 jul, 11:46, Denis Fingonnet <dfingon...@gmail.com> wrote:
> Hello all,
>
> I'm stuck here, I need help from the community.
>
> Here is my schema :
>
> MyUser:
>
> > columns:
> > sf_guard_user_id:
> > type: integer(4)
> > my_customer_id:
> > type: integer
> > email:
> > type: string(255)
> > relations:
> > sfGuardUser:
> > local: sf_guard_user_id
> > foreign: id
> > type: one
> > foreignType: one
> > MyCustomer:
> > local: my_customer_id
> > foreign: id
> > type: one
> > foreignType: many
>
> > MyCustomer:
> > columns:
> > name:
> > type: string(255)
>
> I installed sfDoctrineGuardPlugin and enabled the sfGuardUser module in the
> backend app.
>
> What I'm trying to do, without success, is to add a filter on the
> my_customer.name field in the sfGuardUser list filters.
>
> Here is my sfGuardUserFormFilter class :
>
>
>
> > class sfGuardUserFormFilter extends PluginsfGuardUserFormFilter
> > {
> > public function configure()
> > {
> > $this->widgetSchema['sendit_customer'] = new
> > sfWidgetFormDoctrineChoice(array('model' => 'SenditCustomer', 'add_empty' =>
> > true));
> > $this->validatorSchema['sendit_customer'] = new
> > sfValidatorDoctrineChoice(array('required' => false, 'model' =>
> > 'SenditCustomer', 'column' => 'id'));
> > }
>
> > public function getFields()
> > {
> > $retour = array_merge(array('sendit_customer', 'SenditCustomer'),
> > parent::getFields());
> > return $retour;
> > }
>
> > public function addSenditCustomerColumnQuery(Doctrine_Query $q, $field,
> > $value)
> > {
> > if ($value) {
> > $a = $q->getRootAlias();
> > $q->innerJoin($a . '.SenditUser su')
> > ->andWhere('su.sendit_customer_id = ?', $value);
> > }
> > return $q;
> > }
>
> > }
>
> It doesn't work and I can't find anything usefull on google.
> Any ideas ?
>
> I think I can get the same result by creating a my_user module with the
> admin generator. But I would like to know if I'm wrong anywhere or if it is
> not possible (I doubt of it).
>
> Thanks by advance,
>
> --
> Denis Fingonnet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---