You are here

function PaymentEntityController::view in Payment 7

Implements EntityAPIControllerInterface.

Overrides EntityAPIController::view

File

./payment.classes.inc, line 454
The API and related functions for executing and managing payments.

Class

PaymentEntityController
Entity API controller for payment entities.

Code

function view($entities, $view_mode = 'full', $langcode = NULL, $page = NULL) {
  $build = parent::view($entities, $view_mode, $langcode, $page);
  $type = 'payment';
  foreach ($build['payment'] as &$payment_build) {
    $payment = $payment_build['#entity'];
    $payment_build['payment_line_items'] = payment_line_items($payment);
    $payment_build['payment_status_items'] = payment_status_items($payment);
    $payment_build['payment_method'] = array(
      '#type' => 'item',
      '#title' => t('Payment method'),
      '#markup' => check_plain($payment->method->title_generic),
    );
    drupal_alter(array(
      'payment_view',
      'entity_view',
    ), $payment_build, $type);
  }
  return $build;
}