Difference between revisions of "GroupRule getRuleById"
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | {{HelpFiles}} | ||
− | ====GroupRule_getRuleById==== | + | ==== GroupRule_getRuleById ==== |
− | Get a group rule object by its id. If no rule is found with that id, empty will be returned. | + | Get a group rule object by its id. If no rule is found with that id, empty will be returned. |
− | '''Syntax''' | + | '''Syntax''' |
− | GroupRule_getRuleById(''ruleId'') | + | GroupRule_getRuleById(''ruleId'') |
− | '''Arguments''' | + | '''Arguments''' |
− | * ''ruleId'': is a ''number ''expression. It is the group rule's id, which can be found in the group's Rule tab | + | *''ruleId'': is a ''number ''expression. It is the group rule's id, which can be found in the group's Rule tab |
− | [[Image:6257.jpg]] | + | [[Image:6257.jpg]] |
− | '''Return value''' | + | '''Return value''' |
An ''array'', it is the group rule object, which has following items | An ''array'', it is the group rule object, which has following items | ||
− | [GROUPRULE_TARGET] = GROUPRULE_TARGET_UNLIMITED; | + | <table width="875" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic"><tbody><tr align="left" valign="top"><td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Index</strong></p></td><td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Data type</strong></p></td><td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Value</strong></p></td></tr><tr align="left" valign="top"><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">GROUPRULE_ID</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Id of the group rule</span></p></td></tr><tr align="left" valign="top"><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">GROUPRULE_NAME</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Name of the group rule</span></p></td></tr><tr align="left" valign="top"><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">GROUPRULE_TARGET</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Target of the group rule</span></p></td></tr><tr align="left" valign="top"><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">GROUPRULE_INCLUDE_DELETED</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">bool</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">If the group rule includes deleted users</span></p></td></tr><tr align="left" valign="top"><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">GROUPRULE_INCLUDE_DISABLED</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">bool</span></p></td><td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">If the group rule includes disabled users</span></p></td></tr> |
+ | </tbody></table> | ||
+ | Example | ||
+ | |||
+ | array rule = GroupRule_getRuleById(101919); | ||
+ | |||
+ | rule[GROUPRULE_TARGET] = GROUPRULE_TARGET_UNLIMITED; | ||
+ | |||
+ | GroupRule_save(rule); | ||
− | |||
− | '''Availability''' | + | '''Availability''' |
− | Version 5.6 | + | Version 5.6 |
− | + | ||
− | + | [[Category:Group_Functions]] |
Revision as of 09:07, 27 December 2011
GroupRule_getRuleById
Get a group rule object by its id. If no rule is found with that id, empty will be returned.
Syntax
GroupRule_getRuleById(ruleId)
Arguments
- ruleId: is a number expression. It is the group rule's id, which can be found in the group's Rule tab
Return value
An array, it is the group rule object, which has following items
<tbody> </tbody>Index | Data type | Value |
GROUPRULE_ID | number | Id of the group rule |
GROUPRULE_NAME | string | Name of the group rule |
GROUPRULE_TARGET | number | Target of the group rule |
GROUPRULE_INCLUDE_DELETED | bool | If the group rule includes deleted users |
GROUPRULE_INCLUDE_DISABLED | bool | If the group rule includes disabled users |
Example
array rule = GroupRule_getRuleById(101919);
rule[GROUPRULE_TARGET] = GROUPRULE_TARGET_UNLIMITED;
GroupRule_save(rule);
Availability
Version 5.6