You are here

public function RulesIdentifiableDataWrapper::value in Rules 7.2

Overridden.

Overrides EntityMetadataWrapper::value

2 calls to RulesIdentifiableDataWrapper::value()
RulesIdentifiableDataWrapper::getIdentifier in includes/rules.state.inc
Returns the identifier of the wrapped data.
RulesTestTypeWrapper::save in tests/rules_test.rules.inc
Implements RulesDataWrapperSavableInterface::save().

File

includes/rules.state.inc, line 719
Contains the state and data related stuff.

Class

RulesIdentifiableDataWrapper
A wrapper class similar to the EntityDrupalWrapper, but for non-entities.

Code

public function value(array $options = array()) {
  $this
    ->setData(parent::value());
  if (!$this->data && !empty($this->id)) {

    // Lazy load the data if necessary.
    $this->data = $this
      ->load($this->id);
    if (!$this->data) {
      throw new EntityMetadataWrapperException('Unable to load the ' . check_plain($this->type) . ' with the id ' . check_plain($this->id) . '.');
    }
  }
  return $this->data;
}