You are here

function eck_property_behavior_implements in Entity Construction Kit (ECK) 7.2

Same name and namespace in other branches
  1. 7.3 eck.property_behavior.inc \eck_property_behavior_implements()

Each if a behavior is implemented.

This function checks whether a property is implementing any of the supported property behavior functions.

@todo I think this function could simplify the code of eck_property_behavior_invoke_plugin and alter().

4 calls to eck_property_behavior_implements()
eck_entity_property_info_alter in ./eck.module
Implements hook_entity_property_info_alter().
eck_property_behavior_getter in ./eck.property_behavior.inc
Property behavior getter.
eck_property_behavior_setter in ./eck.property_behavior.inc
Property behavior setter.
eck_property_behavior_validation in ./eck.property_behavior.inc
Property behavior validation.

File

./eck.property_behavior.inc, line 19
Property Behaviors.

Code

function eck_property_behavior_implements($entity_type, $property, $function_name) {
  $properties = $entity_type->properties;
  $info = $entity_type->properties[$property];
  $return = FALSE;
  if (array_key_exists('behavior', $info) && !empty($info['behavior'])) {
    $behavior = $info['behavior'];
    $plugin = ctools_get_plugins('eck', 'property_behavior', $behavior);
    $function = ctools_plugin_get_function($plugin, $function_name);
    if ($function) {
      $return = $function;
    }
  }
  return $return;
}