thank you,
but is it possible to get request parameter inside the model layer?
if yes, what is the proper syntax

    //lib/model/Reminder.class.php
    public function save(Doctrine_Connection $conn = null){

//??? $id = $request->getParameter('id'); //not working, how to get
parameter from request in model

        $this->setUserId($id);

        return parent::save($conn);
    }

thank you

On Oct 11, 10:50 pm, Gareth McCumskey <gmccums...@gmail.com> wrote:
> http://www.symfony-project.org/gentle-introduction/1_4/en/06-Inside-t...
>
>
>
> On Mon, Oct 11, 2010 at 1:40 PM, hribo <hribo...@gmail.com> wrote:
> > Hello,
> > basically I need to change POST parameter and retrieve its value in /
> > lib/model/Model.class.php. I can't configure the right syntax.
>
> > after submitting my form, I need to check if inserted email is already
> > stored in sf_guard_user table. when i find the user in db i need to
> > change the field "user_id" that has no value at the beginning.
> > else if email is not already saved in db, i will create a new user.
>
> >  it looks something like this:
>
> > //model/actions.php
>
> >        $user = Doctrine_Core::getTable('sfGuardUser')-
> > >findOneBy('email_address', $request-
> > >getPostParameter('reminder[user_mail]'));
>
> >        if(!$user ){
> >            //create a new user
> >            $user = new sfGuardUser();
>
> >            $user->setUsername($request-
> > >getPostParameter('reminder[user_mail]'));
> >            $user->setEmailAddress($request-
> > >getPostParameter('reminder[user_mail]'));
>
> >            $password = md5($request-
> > >getPostParameter('reminder[user_mail]').rand('11111'.'99999'));
> >            $user->setPassword($password);
>
> >            $user->save();
> >            //??? set POST parameter "user_id" to value $user->getId()
> >        }
> >        else //??? set POST parameter "user_id" to value $user-
> > >getId()
>
> > //lib/model/Reminder.class.php
> >    public function save(Doctrine_Connection $conn = null){
>
> > //???        $this->setUserId($user->getId());
>
> >        return parent::save($conn);
> >    }
>
> > what syntax use to get needed values in places //??? ?
> > thank you very much for help because i am stuck with it a little while
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > 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<symfony-users%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
>
> --
> Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

Reply via email to