You are here

function _eck_get_bundle in Entity Construction Kit (ECK) 7.2

Same name and namespace in other branches
  1. 7.3 includes/eck.drush.inc \_eck_get_bundle()

Bundle visualization.

2 calls to _eck_get_bundle()
drush_eck_entity_construction_kit in includes/eck.drush.inc
Implements drush_hook_command().
drush_eck_entity_construction_kit_all in includes/eck.drush.inc
Implements drush_hook_command().

File

includes/eck.drush.inc, line 186
Drush support for ECK.

Code

function _eck_get_bundle($entity_type, $bundle) {
  $rows = array();
  $blabel = $bundle->label;
  $bname = $bundle->name;
  $instances = field_info_instances($entity_type->name, $bname);
  $tmp = array(
    array(
      t('Bundle:'),
      $blabel . ', ' . $bname,
      'Field Machine Name',
      'Widget',
    ),
    array(
      '--0--',
      '--1--',
      '--2--',
      '--3--',
    ),
  );
  $rows = array_merge($rows, $tmp);
  $first = TRUE;
  foreach ($instances as $key => $field) {
    $rows[] = array(
      $first ? 'Fields:' : '',
      $field['label'],
      $key,
      $field['widget']['type'],
    );
    $first = FALSE;
  }
  $rows[] = array(
    '',
  );
  return $rows;
}