You are here

protected function CommerceOptionUIController::overviewTableRow in Commerce Product Option 7.2

Generates the row for the passed entity.

Parameters

$additional_cols: Additional columns to be added after the entity label column.

Overrides EntityDefaultUIController::overviewTableRow

File

./commerce_option.inc, line 34
Extends the EntityDefaultUIController so we have a better admnin UI.

Class

CommerceOptionUIController
@file Extends the EntityDefaultUIController so we have a better admnin UI.

Code

protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {

  // Option ID.
  $row[] = $entity->option_id;

  // Type
  $row[] = entity_label($this->entityType, $entity);

  // Order info.
  $line_item = commerce_line_item_load($entity->line_item_id);
  $liw = entity_metadata_wrapper('commerce_line_item', $line_item);
  $row[] = l($liw->order_id
    ->value(), 'admin/commerce/orders/' . $liw->order_id
    ->value() . '/view');
  $row[] = $liw->commerce_product->title
    ->value();
  $row[] = $liw->commerce_product->product_id
    ->value();

  // Operations.
  $row[] = l(t('edit'), $this->path . '/manage/' . $id);
  $row[] = l(t('delete'), $this->path . '/manage/' . $id . '/delete', array(
    'query' => drupal_get_destination(),
  ));
  return $row;
}