Nevermind I fixed this.
On Sep 15, 10:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi, I'm new to symfony and I'm developing a site where users can
> either be automatically generated or register, and I'm trying to
> figure out the best way to implement a Propel Post validator.
>
> There's a column in the User table: Temporary: boolean, and the Email
> column is unique.
>
> If a user tries to register, the script should first check if his or
> her email already exists in the table, and if Temporary is true. If
> Temporary is true and user exists, the script will validate true, but
> if Temporary is false and user exists the script should validate
> false.
>
> I tried using the Post Validators generated in my base class in
> UserForm.class.php:
>
> $this->validatorSchema->setPostValidator(new sfValidatorAnd(
> new sfValidatorSchemaCompare('password',
> sfValidatorSchemaCompare::EQUAL, 'confirm')),
> new sfValidatorAnd(array(
> new sfValidatorPropelUnique(array('model' => 'SmsUser',
> 'column' => array('phone'))),
> new sfValidatorPropelUnique(array('model' => 'SmsUser',
> 'column' => array('email'))),
> ))
> );
>
> Should I add a criteria:
>
> $c = new Criteria();
> $c->add(UserPeer::TEMPORARY, false);
>
> and then add it as a second argument on sfValidatorPropelUnique()?
>
> Any help for a symfony beginner would be appreciated.
>
> Thanks,
>
> Brendan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---