commerce_cardonfile_handler_field_card_exp.inc in Commerce Card on File 7.2
File
includes/views/handlers/commerce_cardonfile_handler_field_card_exp.inc
View source
<?php
class commerce_cardonfile_handler_field_card_exp extends views_handler_field_entity {
function render($values) {
if (!isset($this->entities[$this->view->row_index])) {
return '';
}
$card = $this->entities[$this->view->row_index];
$wrapper = entity_metadata_wrapper('commerce_cardonfile', $card);
$output = $wrapper->card_exp
->value();
if (!commerce_cardonfile_validate_card_expiration($card)) {
$output = '<div class="card-expired">' . $output . '</div>';
$output .= '<div class="card-expired-description">' . t('Expired') . '</div>';
}
return $output;
}
}