function entity_get_all_property_info

7.x entity.property.inc entity_get_all_property_info($entity_type = NULL)

Gets an array of info about all properties of a given entity type.

In contrast to entity_get_property_info(), this function returns info about all properties the entity might have, thus it adds an all properties assigned to entity bundles.

Parameters

$entity_type: (optiona) The entity type to return properties for.

Return value

An array of info about properties. If the type is ommitted, all known properties are returned.

7 calls to entity_get_all_property_info()
Entity::getTranslation in entity/includes/entity.inc
Gets the raw, translated value of a property or field.
EntityDefaultI18nStringController::translatableProperties in entity/entity.i18n.inc
Defines translatable properties used by self::hook_object_info().
entity_metadata_table_query in entity/modules/callbacks.inc
Callback for querying entity properties having their values stored in the entities main db table.
entity_property_query in entity/includes/entity.property.inc
Queries for entities having the given property value.
entity_token_token_info_alter in entity/entity_token.tokens.inc
Implements hook_token_info_alter().

... See full list

File

entity/includes/entity.property.inc, line 75
Provides API functions around hook_entity_property_info(). Also see entity.info.inc, which cares for providing entity property info for all core entity types.

Code

function entity_get_all_property_info($entity_type = NULL) {
  if (!isset($entity_type)) {
    // Retrieve all known properties.
    $properties = array();
    foreach (entity_get_info() as $entity_type => $info) {
      $properties += entity_get_all_property_info($entity_type);
    }
    return $properties;
  }
  // Else retrieve the properties of the given entity type only.
  $info = entity_get_property_info($entity_type);
  $info += array(
    'properties' => array(),
    'bundles' => array(),
  );
  // Add all bundle properties.
  foreach ($info['bundles'] as $bundle => $bundle_info) {
    $bundle_info += array('properties' => array());
    $info['properties'] += $bundle_info['properties'];
  }
  return $info['properties'];
}