You are here

public function PartyMergeProcessMergeDataSet::previewRows in Party 7

File

includes/entity_merge/processes/party.merge_dataset.inc, line 50
Contains merge process for merging a data set.

Class

PartyMergeProcessMergeDataSet
@file Contains merge process for merging a data set.

Code

public function previewRows($prefix = 'data_set:') {
  $ds_name = $this->conf['data_set_name'];
  $prefix .= $this->conf['data_set_name'] . ':';
  $info = party_get_data_set_info($ds_name);
  $class = $info['class'];
  $ds_rows = $class::mergePreviewRows($this->entity1
    ->getDataSetController($ds_name), $this->entity2
    ->getDataSetController($ds_name));
  $rows = array();
  if (!empty($ds_rows)) {
    $rows[$prefix . ':header'] = array(
      array(
        'colspan' => 3,
        'class' => array(
          'entity-merge-ui-header',
        ),
        'header' => TRUE,
        'data' => $info['label'],
      ),
    );
    foreach ($ds_rows as $name => $row) {
      $rows[$prefix . ':' . $name] = $row;
    }
  }
  return $rows;
}