You are here

function assets_get_types in Asset 7

Gets an array of all asset types, keyed by the type name.

Parameters

$type_name: If set, the type with the given name is returned.

Return value

AssetType[]|AssetType Depending whether $type isset, an array of asset types or a single one.

12 calls to assets_get_types()
AssetFeedsProcessor::configDefaults in modules/asset_feeds/AssetFeedsProcessor.inc
Override parent::configDefaults().
assets_get_type in ./asset.module
Returns the asset type of the passed asset or asset type string.
assets_pre_render_text_format in ./asset.module
This function adds a settings required by assets
asset_ckeditor_plugin in ./asset.module
Implements hook_ckeditor_plugin().
asset_field_extra_fields in ./asset.module
Implements hook_field_extra_fields().

... See full list

1 string reference to 'assets_get_types'
asset_type_form in includes/asset.admin.inc
Generates the asset type editing form.

File

./asset.module, line 118
Asset module.

Code

function assets_get_types($type_name = NULL) {
  $types = entity_load_multiple_by_name('asset_type', isset($type_name) ? array(
    $type_name,
  ) : FALSE);
  return isset($type_name) ? reset($types) : $types;
}