You are here

function farm_crop_families in farmOS 7

Load Crop Family terms.

4 string references to 'farm_crop_families'
farm_crop_farm_ui_entity_views in modules/farm/farm_crop/farm_crop.module
Implements hook_farm_ui_entity_views().
farm_crop_field_default_field_bases in modules/farm/farm_crop/farm_crop.features.field_base.inc
Implements hook_field_default_field_bases().
farm_crop_taxonomy_default_vocabularies in modules/farm/farm_crop/farm_crop.features.taxonomy.inc
Implements hook_taxonomy_default_vocabularies().
farm_crop_views_default_views in modules/farm/farm_crop/farm_crop.views_default.inc
Implements hook_views_default_views().

File

modules/farm/farm_crop/farm_crop.module, line 204

Code

function farm_crop_families() {

  // Start empty array.
  $families = array();

  // Load the vocabulary.
  $vocabulary = taxonomy_vocabulary_machine_name_load('farm_crop_families');

  // Return empty array if vocabulary is not found.
  if (empty($vocabulary) || !isset($vocabulary->vid)) {
    return $families;
  }

  // Load all terms in the farm_crop_families vocabulary.
  return taxonomy_get_tree($vocabulary->vid);
}