IgeObject

Method: inGroup

Checks if the entity is in the group or array of group names passed.
inGroup (* groupName, Boolean matchAllGroups)
  • *groupName A group name or array of names.
  • BooleanmatchAllGroups If set to true, will cause the method to check if the entity is in ALL the groups, otherwise the method will check if the entity is in ANY group.
Returns Boolean

Check if the entity is in a group

var entity = new IgeEntity();
entity.addGroup('g1', 'g2');

// Will output true since entity is part of g1 group
console.log(entity.inGroup('g1', false);

// Will output false since entity is not part of g3 group
console.log(entity.inGroup('g3', false);

Check if the entity is in an array of groups using ANY and ALL options

var entity = new IgeEntity();
entity.addGroup('g1', 'g2');

// Will output true since entity is part of g1 group
console.log(entity.inGroup(['g1, 'g3'], false);

// Will output false since entity is not part of g3 group
console.log(entity.inGroup(['g1, 'g3'], true);
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point