You are here

function config_pages_load_entity in Config Pages 7

Load configuration entity.

9 calls to config_pages_load_entity()
config_pages_config in ./config_pages.inc
Returns config pages metawrapper.
config_pages_features_export_options in ./config_pages.features.inc
Implements hook_features_export_options().
config_pages_features_export_render in ./config_pages.features.inc
Implements hook_features_export_render().
config_pages_features_rebuild in ./config_pages.features.inc
Implements hook_features_rebuild().
config_pages_form_wrapper in ./config_pages.admin.inc
Form callback wrapper: create or edit a config_pages.

... See full list

File

./config_pages.inc, line 261
Logic functions.

Code

function config_pages_load_entity($type = '', $context = NULL, $all = FALSE) {
  $conditions = array();

  // Build conditions.
  if (!empty($type)) {
    $conditions['type'] = $type;

    // Get current context if NULL.
    if (!$all && $context === NULL) {
      $context = config_pages_context_get($type);
    }
    if (!$all) {
      $conditions['context'] = $context;
    }
  }
  $list = entity_load('config_pages', FALSE, $conditions);
  return $all ? $list : current($list);
}