That should be working.. when you enable sfGuard you change the base class of the myUser class to gain access to $this->getUser()->getGuardUser().
Can you check the class type of $this->getUser() ? [ get_class($this->getUser()) ] On Mon, Dec 6, 2010 at 11:56, Gareth McCumskey <[email protected]> wrote: > As far as I am aware $this->getUser() does not access your own class that > overrides sfBasicSecurityUser but is in fact an instance of > sfBasicSecurityUser. I stand to be corrected however. > > On Mon, Dec 6, 2010 at 3:59 PM, Carlos <[email protected]> wrote: > >> Hi, >> >> I added some methods to myUser class, and suddenly I can't access to >> them from the action. >> $this->getUser()->method returns a "Call to undefined method" error >> message. I really think it was working before... Maybe I modified any >> yml file? >> >> My myUser class and one of this methods: >> >> class myUser extends sfBasicSecurityUser >> { >> const INFO_MESSAGE = 'infoMessages'; >> const WARNING_MESSAGE = 'warnMessages'; >> const ERROR_MESSAGE = 'errorMessages'; >> >> /** >> * Adds messages to user flash >> * >> * @param string $msg >> * @param string $level >> */ >> public function addMessage($msg, $level = myUser::INFO_MESSAGE) >> { >> // Gets the existing array, returns an empty array otherwise. >> $flashContent = $this->getFlash($level, array()); >> >> // If messages doesn't exists, it's loaded into flash. >> if(!in_array($msg, $flashContent)) >> { >> $flashContent[] = $msg; >> $this->setFlash($level, $flashContent); >> } >> } >> ... >> } >> >> Thanks, >> >> Carlos >> >> -- >> 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 [email protected] >> To unsubscribe from this group, send email to >> [email protected]<symfony-users%[email protected]> >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en >> > > > > -- > Gareth McCumskey > http://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 [email protected] > To unsubscribe from this group, send email to > [email protected]<symfony-users%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Alex Pilon (613) 608-1480 -- 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 [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
