You are here

public function RulesCondition::import in Rules 7.2

Applies the given export.

Overrides RulesAbstractPlugin::import

File

includes/rules.plugins.inc, line 136
Contains plugin info and implementations not needed for rule evaluation.

Class

RulesCondition
Implements a rules condition.

Code

public function import(array $export) {
  $this->elementName = rules_array_key($export);
  if (strpos($this->elementName, 'NOT ') === 0) {
    $this->elementName = substr($this->elementName, 4);
    $this->negate = TRUE;
  }

  // After setting the element name, setup the element again so the right
  // element info is loaded.
  $this
    ->setUp();

  // Re-add 'USING' which has been removed for abbreviation.
  $this
    ->importSettings(array(
    'USING' => reset($export),
  ));
}