You are here

protected function EntityDrupalWrapper::spotInfo in Entity API 7

Used to lazy-load bundle info. So the wrapper can be loaded e.g. just for setting without the data being loaded.

Overrides EntityStructureWrapper::spotInfo

1 call to EntityDrupalWrapper::spotInfo()
EntityDrupalWrapper::getBundle in includes/entity.wrapper.inc
Returns the bundle of an entity, or FALSE if it has no bundles.

File

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

Class

EntityDrupalWrapper
Provides a wrapper for entities registrered in hook_entity_info().

Code

protected function spotInfo() {
  if (!$this->propertyInfoAltered) {
    if ($this->info['type'] == 'entity' && $this
      ->dataAvailable() && $this
      ->value()) {

      // Add in entity-type specific details.
      $this
        ->setUp();
    }
    $this
      ->spotBundleInfo(TRUE);
    parent::spotInfo();
    $this->propertyInfoAltered = TRUE;
  }
}