You are here

function _commerce_file_get_entity_type in Commerce File 7

Return entity type from an entity

1 call to _commerce_file_get_entity_type()
_commerce_file_field_aggregate_files in includes/
Return all commerce_file fields for a given entity, indexed by fid


./commerce_file.module, line 1281
Provides integration of file licenses with Commerce


function _commerce_file_get_entity_type($entity) {

  // entity implements an entity class
  if (method_exists($entity, 'entityType')) {
    return $entity

  // entity is an entity wrapper
  if (method_exists($entity, 'type')) {
    return $entity
  return NULL;