function farm_asset_types in farmOS 7
List of asset types.
Parameters
string $type_name: The farm asset type name.
Return value
FarmAssetType|array Returns either a single type, or an array of types.
16 calls to farm_asset_types()
- farm_asset_access in modules/
farm/ farm_asset/ farm_asset.module - Access callback for asset entities.
- farm_asset_add in modules/
farm/ farm_asset/ farm_asset.pages.inc - Add new asset page callback.
- farm_asset_add_access in modules/
farm/ farm_asset/ farm_asset.module - Access callback: Checks whether the user has permission to add an asset.
- farm_asset_add_types_page in modules/
farm/ farm_asset/ farm_asset.pages.inc - Page to select asset type to add new asset.
- farm_asset_entity_info_alter in modules/
farm/ farm_asset/ farm_asset.module - Implements hook_entity_info_alter().
1 string reference to 'farm_asset_types'
- farm_asset_type_form in modules/
farm/ farm_asset/ farm_asset.admin.inc - Generates the farm asset type editing form.
File
- modules/
farm/ farm_asset/ farm_asset.module, line 867 - Farm asset - A farm asset entity type.
Code
function farm_asset_types($type_name = NULL) {
$types = entity_load_multiple_by_name('farm_asset_type', isset($type_name) ? array(
$type_name,
) : FALSE);
return isset($type_name) ? reset($types) : $types;
}