You are here

public function SearchApiAbstractDataSourceController::getMetadataWrapper in Search API 7

Creates a metadata wrapper for this datasource controller's type.

Parameters

mixed $item: Unless NULL, an item of the item type for this controller to be wrapped.

array $info: Optionally, additional information that should be used for creating the wrapper. Uses the same format as entity_metadata_wrapper().

Return value

EntityMetadataWrapper A wrapper for the item type of this data source controller, according to the info array, and optionally loaded with the given data.

Throws

SearchApiDataSourceException If any error state was encountered.

Overrides SearchApiDataSourceControllerInterface::getMetadataWrapper

See also

entity_metadata_wrapper()

1 call to SearchApiAbstractDataSourceController::getMetadataWrapper()
SearchApiAbstractDataSourceController::getItemId in includes/datasource.inc
Retrieves the unique ID of an item.
1 method overrides SearchApiAbstractDataSourceController::getMetadataWrapper()
SearchApiEntityDataSourceController::getMetadataWrapper in includes/datasource_entity.inc
Creates a metadata wrapper for this datasource controller's type.

File

includes/datasource.inc, line 458
Contains the SearchApiDataSourceControllerInterface as well as a default base class.

Class

SearchApiAbstractDataSourceController
Provides a default base class for datasource controllers.

Code

public function getMetadataWrapper($item = NULL, array $info = array()) {
  $info += $this
    ->getPropertyInfo();
  return entity_metadata_wrapper($this->entityType ? $this->entityType : $this->type, $item, $info);
}