You are here

public function PartyDefaultDataSet::invoke in Party 7

Invoke hooks.

Parameters

string $hook: The hook to invoke, e.g. 'save'

3 calls to PartyDefaultDataSet::invoke()
PartyDefaultDataSet::attachEntity in includes/party.data.inc
Attach an entity to the party
PartyDefaultDataSet::detachEntityByDelta in includes/party.data.inc
Detatch an entity by delta
PartyDefaultDataSet::save in includes/party.data.inc
Save the attached entities information

File

includes/party.data.inc, line 928
Provides the default class for managing party - Attached entity relationships.

Class

PartyDefaultDataSet
Class PartyDefaultDataSet

Code

public function invoke($hook) {

  // Get the arguments to be passed to the hook.
  $args = func_get_args();
  array_shift($args);
  array_unshift($args, $this);

  // Generate hook names.
  $generic_hook = 'party_data_set_' . $hook;
  $specific_hook = 'party_data_set_' . $hook . '_' . $this->data_set;

  // Call generic hook.
  array_unshift($args, $generic_hook);
  call_user_func_array('module_invoke_all', $args);

  // Call specific hook.
  $args[0] = $specific_hook;
  call_user_func_array('module_invoke_all', $args);
}