Difference between revisions of "GroupRule getRuleById"
(jrfconvert import) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | | ||
− | + | == 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 |
− | |||
− | |||
− | |||
− | + | {| width="875" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic" | |
− | + | |- align="left" valign="top" | |
− | < | + | | width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;" | |
+ | '''Index''' | ||
+ | |||
+ | | width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;" | | ||
+ | '''Data type''' | ||
+ | |||
+ | | width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;" | | ||
+ | '''Value''' | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">GROUPRULE_ID</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">number</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">Id of the group rule</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">GROUPRULE_NAME</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">string</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">Name of the group rule</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">GROUPRULE_TARGET</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">number</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">Target of the group rule</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">GROUPRULE_INCLUDE_DELETED</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">bool</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">If the group rule includes deleted users</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">GROUPRULE_INCLUDE_DISABLED</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">bool</span> | ||
+ | |||
+ | | width="292" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">If the group rule includes disabled users</span> | ||
+ | |||
+ | |} | ||
+ | |||
+ | Example | ||
+ | |||
+ | array rule = GroupRule_getRuleById(101919); | ||
+ | |||
+ | rule[GROUPRULE_TARGET] = GROUPRULE_TARGET_UNLIMITED; | ||
+ | |||
+ | GroupRule_save(rule); | ||
+ | |||
+ | <br> '''Availability''' | ||
+ | |||
+ | Version 5.6 | ||
+ | |||
+ | [[Category:Group_Functions]] |
Latest revision as of 09:14, 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
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