You are here

function reference_table_formatter_base_type::get_entity_properties in Reference Table Formatter 7

Get the properties off an entity that are available for rendering.

Return value

array An array of name label, key values.

1 call to reference_table_formatter_base_type::get_entity_properties()
reference_table_formatter_base_type::get_renderable_fields in ./reference_table_formatter_base_type.inc
Get the fields and properties which can be rendered.

File

./reference_table_formatter_base_type.inc, line 87
A base class for the "reference type" plugin.

Class

reference_table_formatter_base_type
Class reference_table_formatter_base_type

Code

function get_entity_properties() {
  $entity_name = $this
    ->entity_name();
  $entity_property_info = entity_get_property_info($entity_name);
  $renderable_properties = $this
    ->renderable_properties();

  // Allow other modules to alter the list of renderable properties.
  drupal_alter('reference_table_formatter_renderable_properties', $renderable_properties, $entity_name);
  $keyed_properties = array();
  foreach ($entity_property_info['properties'] as $name => $info) {
    if (in_array($name, $renderable_properties)) {
      $keyed_properties[$name] = $this
        ->get_entity_property_label($info);
    }
  }
  return $keyed_properties;
}