title: Plugins | sfDoctrineGuardPlugin - set a group to user from frontend
body: <p>I need to set a Group to a user in frontend application. Here what i have done.</p>
  
  <pre><code>$g = sfGuardGroupTable::getInstance()-&gt;findOneById(1);
  
  $u = new sfGuardUser();
  $u-&gt;setFirstName($request-&gt;getParameter('first_name'));
  $u-&gt;setLastName($request-&gt;getParameter('last_name'));
  $u-&gt;setEmailAddress($request-&gt;getParameter('email_address'));  
  $u-&gt;setSfGuardUserGroup($g);
  $u-&gt;save();
  </code></pre>
  
  <p>The user is inserted successfully but I cannot set a group to a user.</p>