You are here

function slickgrid_get_entity_keys in Slickgrid 7.2

Same name and namespace in other branches
  1. 7 slickgrid.module \slickgrid_get_entity_keys()

Helper function for the above class. Returns an array of entity keys which must not be edited.

1 call to slickgrid_get_entity_keys()
slickgrid_views_plugin::field_is_editable in includes/slickgrid_views_plugin.inc

File

includes/slickgrid_views_plugin.inc, line 567

Code

function slickgrid_get_entity_keys($entity_type = null, $keys_to_ignore = array(
  'label',
)) {
  $entity_keys = array();
  if ($entity_type) {
    $entities_info = array(
      entity_get_info($entity_type),
    );
  }
  else {
    $entities_info = entity_get_info();
  }
  foreach ($entities_info as $entity_info) {
    foreach ($keys_to_ignore as $key_to_ignore) {
      unset($entity_info['entity keys'][$key_to_ignore]);
    }
    $entity_keys += array_values($entity_info['entity keys']);
  }
  return $entity_keys;
}