You are here

function assets_get_type in Asset 7

Returns the asset type of the passed asset or asset type string.

Parameters

object|string $asset: An asset object or string that indicates the asset type to return.

Return value

AssetType|bool A single asset type, as an object, or FALSE if the asset type is not found.

File

./asset.module, line 500
Asset module.

Code

function assets_get_type($asset) {
  $type = is_object($asset) ? $asset->type : $asset;
  $types = assets_get_types();
  return isset($types[$type]) ? $types[$type] : FALSE;
}