You are here

public function EntityListWrapper::__construct in Entity API 7

Construct a new wrapper object.

Parameters

$type: The type of the passed data.

$data: Optional. The data to wrap.

$info: Optional. Used internally to pass info about properties down the tree.

Overrides EntityMetadataWrapper::__construct

File

includes/entity.wrapper.inc, line 1013
Provides wrappers allowing easy usage of the entity metadata.

Class

EntityListWrapper
Wraps a list of values.

Code

public function __construct($type, $data = NULL, $info = array()) {
  parent::__construct($type, NULL, $info);
  $this->itemType = entity_property_list_extract_type($this->type);
  if (!$this->itemType) {
    $this->itemType = 'unknown';
  }
  $this->isEntityList = (bool) entity_get_info($this->itemType);
  if (isset($data)) {
    $this
      ->set($data);
  }
}