You are here

protected function CommerceCardOnFile::defaultLabel in Commerce Card on File 7.2

Overrides Entity::defaultLabel().

Overrides Entity::defaultLabel

File

includes/commerce_cardonfile.entity.inc, line 113

Class

CommerceCardOnFile
Entity class representing the commerce_cardonfile entity type.

Code

protected function defaultLabel() {
  $card_type = t('Card');
  if (!empty($this->card_type)) {
    $card_types = commerce_cardonfile_credit_card_types();
    if (isset($card_types[$this->card_type])) {
      $card_type = $card_types[$this->card_type];
    }
  }
  $args = array(
    '@card_type' => $card_type,
    '@card_number' => $this->card_number,
  );
  return t('@card_type ending in @card_number', $args);
}