title: Getting the group_id by using Groups with FOSUserBundle
body: <p>I have configured the FOSUserBundle Group follow <a href="https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/groups.md" rel="nofollow">Using Groups With FOSUserBundle</a> and get it to work.</p>
  
  <pre><code>// src/SM4/UserBundle/Entity/User.php 
  /**
   * @ORM\ManyToMany(targetEntity="SM4\UserBundle\Entity\Group")
   * @ORM\JoinTable(name="sm4_user_group",
   *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
   *      inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
   * )
   */
   protected $groups;
  </code></pre>
  
  <p>Every time it creates a new <code>User</code>, I can use:</p>
  
  <pre><code>$userObj = new \SM4\UserBundle\Entity\User;
  
  $userObj-&gt;getId();
  
  $userObj-&gt;getEmail();
  
  ....
  
  $userObj-&gt;getGroup();
  </code></pre>
  
  <p>But how do I get the <code>Group_id</code> of user?</p>