You are here

function _datalayer_collect_meta_values in dataLayer 7

Same name and namespace in other branches
  1. 8 datalayer.module \_datalayer_collect_meta_values()

Add the meta properties for given entity.

Parameters

array $properties: Selected properties for the entity.

object $entity: The entity.

string $key_prefix: The prefix for the property name.

2 calls to _datalayer_collect_meta_values()
datalayer_get_user_data in ./datalayer.module
Return all user data based on configured URL patterns.
_datalayer_get_entity_data in ./datalayer.module
Collect entity data for output and altering.

File

./datalayer.module, line 473
Client-side data space.

Code

function _datalayer_collect_meta_values(array $properties, $entity, $key_prefix = 'entity') {

  // Build meta output...
  $meta_data = array();
  foreach ($properties as $p) {
    if (isset($entity->{$p})) {
      $meta_data[$key_prefix . ucfirst($p)] = $entity->{$p};
    }
  }
  return $meta_data;
}