title: get all groups from the Users - sfDoctrineGuardPlugin
body: <p>In sfDoctrineGuardPlugin is:</p>
  
  <pre><code>sfGuardUser:
    actAs: [Timestampable]
    columns:
      first_name: string(255)
      last_name: string(255)
      //
    indexes:
      is_active_idx:
        fields: [is_active]
    relations:
      Groups:
        class: sfGuardGroup
        local: user_id
        foreign: group_id
        refClass: sfGuardUserGroup
        foreignAlias: Users
  
  
  
  sfGuardGroup:
    actAs: [Timestampable]
    columns:
      name:
        type: string(255)
        unique: true
      description: string(1000)
    relations:
      Users:
        class: sfGuardUser
        refClass: sfGuardUserGroup
        local: group_id
        foreign: user_id
        foreignAlias: Groups
  
  sfGuardUserGroup:
    options:
      symfony:
        form:   false
        filter: false
    actAs: [Timestampable]
    columns:
      user_id:
        type: integer
        primary: true
      group_id:
        type: integer
        primary: true
    relations:
      User:
        class: sfGuardUser
        local: user_id
        onDelete: CASCADE
      Group:
        class: sfGuardGroup
        local: group_id
        onDelete: CASCADE
  </code></pre>
  
  <p>This is relation many to many and how can i get all groups of User?</p>
  
  <blockquote>
    <ul>
    <li>@method Doctrine_Collection<br>
    getGroups()                Returns the
    current record's "Groups" collection</li>
    </ul>
  </blockquote>
  
  <p>i make:</p>
  
  <pre><code>$this-&gt;groups = $this-&gt;getUser()-&gt;getGuardUser()-&gt;getGroups();
  </code></pre>
  
  <p>this return:</p>
  
  <pre> Doctrine_Collection data : Array( ) </pre>
  
  <p>how can i check whether the user is on group TEST?</p>
  
  <p>Thanks for help!</p>