You are here

function patterns_history_set_parent in Patterns 7.2

Adds a parent tag in the info section of the pattern.

Parameters

array $pattern : Pattern in which the new header will be appended

string $host: URL of the instance that performed the action

string: $d2d_id D2D ID of the instance that performed the action

string $action: Action that has produced this pattern, for now 'merge', 'pull', or 'push'

array $parents: Array of UUUIDs of the parents

Return value

Pattern including the new header

1 call to patterns_history_set_parent()
patterns_lab_submit in includes/forms/lab.inc
Exports selected patterns either in a file or as a zip-archive

File

includes/history.inc, line 25
Manipulates pattern files to add information about the history of merging and pulling.

Code

function patterns_history_set_parent(&$pattern, $host, $d2d_id, $action, $parents) {
  $pattern['info']['parent'] = array();
  $pattern['info']['parent']['host'] = $host;
  $pattern['info']['parent']['d2d_id'] = $d2d_id;
  $pattern['info']['parent']['action'] = $action;
  $pattern['info']['parent']['date'] = date_timestamp_get(date_create());
  foreach ($parents as $uuuid) {
    $pattern['info']['parent']['uuuids'][] = $uuuid;
  }
}