Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how to check if email address existed in db
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ethan  
View profile  
 More options May 22 2011, 8:00 am
From: Ethan <ruanx...@gmail.com>
Date: Sun, 22 May 2011 20:00:56 +0800
Local: Sun, May 22 2011 8:00 am
Subject: how to check if email address existed in db

hello,everyone,
i created a register form:
class RegForm extends sfForm{
public function configure(){
               $this->setWidgets(array(
                      ...
                       'email'=> new
sfWidgetFormInputText(array('label'=>'email address:','default'=>'@')),
                     ....
                ));
                $this->setValidators(array(
                       ...
                       'email'=>new
sfValidatorEmail(array(),array('required'=>'Email cannot
empty','invalid'=>'Email invalid')),
                       ...
               ));
              $this->setValidator('email',new
sfValidatorPropelUnique(array('model'=>'Userinfo','column'=>array('Uemail') ),array('invalid'=>'email
EXISTS.')));
        }

}

and i want to check whether email address existed in db before user
register. according to document, it seems need to use *sfValidatorPropelUnique
*,but when i try to add the red code, i received an error
 You must pass an array parameter to the clean() method (this validator can
only be used as a post validator).
can someone told me the right way to do this process?

------------------------------------------
         少许诺多兑现
------------------------------------------


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gábor Fási  
View profile  
 More options May 23 2011, 4:48 am
From: Gábor Fási <maerl...@gmail.com>
Date: Mon, 23 May 2011 10:48:33 +0200
Local: Mon, May 23 2011 4:48 am
Subject: Re: [symfony-users] how to check if email address existed in db
Two points:

- you're trying to overwrite the existing validator of the email field

- as the error message says: sfValidatorPropelUnique may only be used
as a post validator. Here's an example:

$this->validatorSchema->setPostValidator(
  new sfValidatorPropelUnique(array(
    "throw_global_error"  =>  false,
    "model"   =>              "sfGuardUser",
    "column"  =>              "username",
    "field"   =>              array("email"),
  ), array(
    "invalid" =>  "Már használt e-mail cím!",
  ))
);

-- mrl

2011/5/22 Ethan <ruanx...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin H  
View profile  
 More options May 24 2011, 2:15 pm
From: Justin H <justin.hil...@gmail.com>
Date: Tue, 24 May 2011 11:15:27 -0700 (PDT)
Local: Tues, May 24 2011 2:15 pm
Subject: Re: how to check if email address existed in db
u could make the field unique in your schema

On May 22, 5:00 am, Ethan <ruanx...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »