Difference between revisions of "GroupRule getRuleById"

From Catglobe Wiki
Jump to: navigation, search
 
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.  
Line 17: Line 17:
 
'''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  
<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);
+
{| 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'''
  
'''Availability'''  
+
| 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  
 
Version 5.6  
  
 
[[Category:Group_Functions]]
 
[[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

6257.jpg

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