You are here

function commerce_cardonfile_handler_field_card_number::get_value in Commerce Card on File 7.2

Return the entity object or a certain property of the entity.

Overrides views_handler_field_entity::get_value

File

includes/views/handlers/commerce_cardonfile_handler_field_card_number.inc, line 29

Class

commerce_cardonfile_handler_field_card_number
Field handler to present the truncated card number with optional formatting.

Code

function get_value($values, $field = NULL) {
  if (!isset($this->entities[$this->view->row_index])) {
    return '';
  }
  $card = $this->entities[$this->view->row_index];
  if ($this->options['format']) {
    return commerce_cardonfile_format_credit_card_number($card->card_number, $card->card_type);
  }
  else {
    return $card->card_number;
  }
}