You are here

function entity_background_get_background_plugin_function in Entity background 7

Get the specified background plugin function if it exist.

Parameters

$entity_type: An entity type which background should be loaded.

$entity: An entity object which background should be loaded.

$function_name: A name of the plugin function to run.

Return value

string|boolean The background plugin function name or FALSE if it does not exist.

1 call to entity_background_get_background_plugin_function()
entity_background_load_background in ./entity_background.module
Loads background plugins.

File

./entity_background.module, line 81
Module file entity background.

Code

function entity_background_get_background_plugin_function($entity_type, $entity, $function_name) {
  $plugin = FALSE;

  // Get the plugin.
  if (entity_background_has_background_field($entity)) {

    // Plugin must be found.
    $plugin = entity_background_find_background_plugin($entity_type, $entity);
  }

  // Get the function.
  if ($plugin && isset($plugin[$function_name])) {
    return $plugin[$function_name];
  }
  else {
    return FALSE;
  }
}