You are here

function pdfthumb_entity_get_bundle in PDFThumb 7

Return the current bundle name.

Parameters

object $entity: The entity object

string $entity_type: The entity type

Return value

string Current bundle name

1 call to pdfthumb_entity_get_bundle()
pdfthumb_process in ./pdfthumb.module
Find a PDF field for generate a thumb after saving or updating a node

File

./pdfthumb.module, line 233
Give a way to create pdf thumbnails.

Code

function pdfthumb_entity_get_bundle($entity, $entity_type) {
  $info = entity_get_info($entity_type);
  if (empty($info['entity keys']['bundle'])) {
    return $entity_type;
  }
  else {
    return $entity->{$info['entity keys']['bundle']};
  }
}