/** * Returns the table view HTML for a given attribute. * * @param BaseElementModel $element * @param string $attribute * @return string */ public function getTableAttributeHtml(BaseElementModel $element, $attribute) { switch ($attribute) { case 'mode': return ucwords($element->mode); case 'planAmount': if ($element->planType == 'recurring') { return $element->formatPlanName(); } else { return $element->formatPlanAmount(); } case 'customerName': return $element->customerName . ' <a href="mailto:' . $element->customerEmail . '">' . $element->customerEmail . '</a>'; case 'cardLast4': return '<span class="cardType type' . $element->cardType . '"></span> ' . $element->formatCard(); case 'planType': if ($element->planType == 'recurring') { return ucwords($element->planType); } else { return 'One-time'; } case 'timestamp': if ($element->timestamp) { return $element->timestamp->localeDate(); } else { return ''; } } }