You are here

public function WebformRulesSubmissionWrapper::__construct in Webform Rules 7

Construct a new wrapper object.

Parameters

$type: The type of the passed data.

$data: (optional) The data to wrap or its identifier.

array $info: (optional) Used internally to pass info about properties down the tree.

Overrides RulesIdentifiableDataWrapper::__construct

File

./webform_rules.rules.inc, line 463
Functions for rules integration.

Class

WebformRulesSubmissionWrapper
Provide entity-like access to webform submission data.

Code

public function __construct($type, $data = NULL, $info = array()) {
  if (!is_null($data)) {

    // If we have a webform submission, add the form values as properties.
    // (If we do not have a submission, properties are added by assertion.
    // @see webform_rules_condition_data_nid_assertions()).
    $info['property info alter'] = array(
      'WebformRulesSubmissionWrapper',
      'webformSubmissionValues',
    );
  }
  parent::__construct($type, $data, $info);
  $this
    ->setData($data);
}