You are here

public function Entity::bundle in Entity API 7

Returns the bundle of the entity.

Return value

string The bundle of the entity. Defaults to the entity type if the entity type does not make use of different bundles.

Overrides EntityInterface::bundle

File

includes/entity.inc, line 255
Provides a base class for entities.

Class

Entity
A common class for entities.

Code

public function bundle() {
  return !empty($this->entityInfo['entity keys']['bundle']) ? $this->{$this->entityInfo['entity keys']['bundle']} : $this->entityType;
}