protected function Asset::defaultLabel in Asset 7
Defines the entity label if the 'entity_class_label' callback is used.
Overrides Entity::defaultLabel
File
- includes/
asset.controllers.inc, line 43 - Provides a controller classes for Asset and related entities
Class
- Asset
- Use a separate class for assets so we can specify some defaults.
Code
protected function defaultLabel() {
if (!empty($this->title)) {
return $this->title;
}
$bundle_key = $this->entityInfo['entity keys']['bundle'];
return $this->entityInfo['bundles'][$this->{$bundle_key}]['label'];
}