/**
  * Overrides the rule of the filter.
  *
  * @param block_xp_rule $rule
  */
 public function set_rule(block_xp_rule $rule)
 {
     $this->rule = $rule;
     $this->ruledata = json_encode($rule->export());
 }
示例#2
0
 /**
  * Export the properties and their values.
  *
  * @return array Keys are properties, values are the values.
  */
 public function export()
 {
     $properties = parent::export();
     $properties['method'] = $this->method;
     $properties['rules'] = array();
     foreach ($this->rules as $rule) {
         $properties['rules'][] = $rule->export();
     }
     return $properties;
 }
 /**
  * Export the properties and their values.
  *
  * This must return all the values required by the {@link self::create()} method.
  *
  * @return array Keys are properties, values are the values.
  */
 public function export()
 {
     $properties = parent::export();
     $properties['compare'] = $this->compare;
     $properties['value'] = $this->value;
     return $properties;
 }