You are here

function eck__bundle__load in Entity Construction Kit (ECK) 7

Get all the bundles for a given entity_type.

Parameters

$entity_type_name: (String) the name of an entity type

6 calls to eck__bundle__load()
eck_permission in ./eck.module
Implements hook_permission().
eck__bundle__add_validate in ./eck.bundle.inc
Validation for bundle creation (Make sure this bundle don't exist for thie entity type)
eck__bundle__menu in ./eck.bundle.inc
This function creates the menu items relevant to bundle administration
eck__bundle__overview in ./eck.bundle.inc
Page call back for the bundle overview table (to see and manipulate all created label of a given type)
eck__entity_type__delete in ./eck.entity_type.inc
Delete the entity type

... See full list

File

./eck.bundle.inc, line 85
All of the menu, pages, and forms related to bundle administration.

Code

function eck__bundle__load($entity_type_name = NULL) {
  $query = db_select('eck_bundle', 't')
    ->fields('t');
  if ($entity_type_name) {
    $query
      ->condition('entity_type', $entity_type_name);
  }
  $data = $query
    ->execute();
  $bundles = array();
  foreach ($data as $bundle) {
    $bundles[] = $bundle;
  }
  return $bundles;
}