You are here

public function RulesPlugin::__sleep in Rules 7.2

2 calls to RulesPlugin::__sleep()
RulesAbstractPlugin::__sleep in includes/rules.core.inc
RulesContainerPlugin::__sleep in includes/rules.core.inc
2 methods override RulesPlugin::__sleep()
RulesAbstractPlugin::__sleep in includes/rules.core.inc
RulesContainerPlugin::__sleep in includes/rules.core.inc

File

includes/rules.core.inc, line 1192
Rules base classes and interfaces needed for any rule evaluation.

Class

RulesPlugin
Base class for rules plugins.

Code

public function __sleep() {

  // Keep the id always as we need it for the recursion prevention.
  $array = drupal_map_assoc(array(
    'parent',
    'id',
    'elementId',
    'weight',
    'settings',
  ));

  // Keep properties related to configurations if they are there.
  $info = entity_get_info('rules_config');
  $fields = array_merge($info['schema_fields_sql']['base table'], array(
    'recursion',
    'tags',
  ));
  foreach ($fields as $key) {
    if (isset($this->{$key})) {
      $array[$key] = $key;
    }
  }
  return $array;
}