How to programmatically list member entities of an Organic Group? How can I programmatically get a list of member entities of an Organic Group?

(I know how to get a list of group members using Views — I'd prefer to do this using the Organic Groups API, but haven't been able to find the right method.)
Using directly the Organic Groups API:

og_get_group_members_properties($yourGroupNode, array(), 'members', 'node');


gives you an array of user ids.

To obtain only active, pending or blocked users, you can put 'members__1', 'members__2' or 'members__3' in place of 'members', like in this example:

og_get_group_members_properties($yourGroupNode, array(), 'members__1', 'node');


of, if you prefer, like this one:

og_get_group_members_properties($yourGroupNode, array(), 'members__' . OG_STATE_ACTIVE, 'node');


Example of the returned value:

Array
(
    [0] =&gt; 48
    [1] =&gt; 49
    [2] =&gt; 51
)