You are here

function eck_entity_property_info_alter in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7 eck.module \eck_entity_property_info_alter()
  2. 7.2 eck.module \eck_entity_property_info_alter()

Implements hook_entity_property_info_alter().

File

./eck.module, line 451

Code

function eck_entity_property_info_alter(&$info) {
  foreach (EntityType::loadAll() as $entity_type) {
    $entity_property_info = $info[$entity_type->name];
    $entity_property_info = eck_property_behavior_invoke_plugin_alter($entity_type, 'property_info', $entity_property_info);
    foreach ($entity_type->properties as $property => $stuff) {
      foreach (array(
        'setter',
        'getter',
        'validation',
      ) as $function_name) {
        if (eck_property_behavior_implements($entity_type, $property, $function_name)) {
          $entity_property_info['properties'][$property]["{$function_name} callback"] = "eck_property_behavior_{$function_name}";
        }
      }
    }
    if ($entity_property_info) {
      $info[$entity_type->name] = $entity_property_info;
    }
  }
}