コード例 #1
0
 /**
  * Returns a list of variables that should be included in serialization,
  * i.e. these values are the only ones that are stored in DB
  *
  * @since  1.0.0
  * @internal
  * @return array
  */
 public function __sleep()
 {
     /*
      * Rule values are pre-processd before saving...
      * Note: $this->_rules only contains rules for the *current* site, so
      * all rules that are serialized here get the current-site prefix.
      * Rules for the other sites are already in the $this->rule_values
      * array and were not de-serialized on page load.
      */
     $this->rule_values = lib3()->array->get($this->rule_values);
     foreach ($this->_rules as $rule_type => $rule) {
         $key = MS_Rule::rule_key($rule_type);
         $this->rule_values[$key] = $rule->serialize();
         if (empty($this->rule_values[$key])) {
             unset($this->rule_values[$key]);
         }
     }
     return array('id', 'name', 'title', 'description', 'rule_values', 'type', 'payment_type', 'active', 'private', 'is_free', 'disabled_gateways', 'price', 'period', 'pay_cycle_period', 'pay_cycle_repetitions', 'period_date_start', 'period_date_end', 'trial_period_enabled', 'trial_price', 'trial_period', 'on_end_membership_id', 'is_setup_completed', 'source', 'source_id', 'custom_data', 'update_denied', 'update_replace');
 }