Difference between revisions of "GroupBuilderProtectedUntilVariable class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=GroupBuilderProtectedUntilVariable |Description=Represents a group builder variable for users that are available at the given day. |Constructors...")
 
Line 11: Line 11:
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 
}}
 
}}
 +
=== <span style="color:#DF8621">'''Examples'''</span> ===
 +
<source lang="javascript">
 +
//Create a new group
 +
string groupName = "Test Group Builder: protectedUntilVariable";
 +
number groupTemplateResourceId=2066;
 +
number parentResourceId = 11088827;
 +
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
 +
Group_save(group);
 +
number groupRId = group[GROUP_RESOURCE_ID ];
 +
//Create rule for the group
 +
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);
 +
GroupBuilderProtectedUntilVariable protectedUntilVariable = new GroupBuilderProtectedUntilVariable();
 +
DateTime date = new DateTime("2017-4-19");
 +
protectedUntilVariable.ProtectedUntilDate = date;
 +
GroupBuilderRule rule = new GroupBuilderRule (root);
 +
rule.Add(protectedUntilVariable);
 +
GroupBuilderRuleCollection ruleColection = root.RootRules;
 +
ruleColection.Add(rule);
 +
root.Save();
 +
</source>

Revision as of 03:14, 19 April 2017

GroupBuilderProtectedUntilVariable



Represents a group builder variable for users that are available at the given day.

Constructors

  • () - Create new variable

Methods

  • string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • DateTime ProtectedUntilDate { get; set; } - The date to check if a user is available
  • TypeInformation TypeInformation { get; } - Get information about this class.

Examples

//Create a new group
string groupName = "Test Group Builder: protectedUntilVariable";
number groupTemplateResourceId=2066;
number parentResourceId = 11088827;
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
Group_save(group);
number groupRId = group[GROUP_RESOURCE_ID ]; 
//Create rule for the group
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);
GroupBuilderProtectedUntilVariable protectedUntilVariable = new GroupBuilderProtectedUntilVariable();
DateTime date = new DateTime("2017-4-19");
protectedUntilVariable.ProtectedUntilDate = date; 
GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(protectedUntilVariable); 
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule); 
root.Save();