Exemplo n.º 1
0
 /**
  * Preprocess type
  *
  * @param string                           $value  Status code
  * @param array                            $column Column info
  * @param \XLite\Model\Payment\Transaction $entity Payment transaction
  *
  * @return string
  */
 protected function preprocessType($value, array $column, \XLite\Model\Payment\Transaction $entity)
 {
     $list = \XLite\Model\Payment\BackendTransaction::getTypes();
     return static::t($list[$value]);
 }
Exemplo n.º 2
0
 /**
  * Retrieve property from the model object
  *
  * @param mixed $name Field/property name
  *
  * @return mixed
  */
 protected function getModelObjectValue($name)
 {
     $result = parent::getModelObjectValue($name);
     switch ($name) {
         case 'date':
             $result = $this->formatTime($result);
             break;
         case 'method_name':
             $result = $this->getModelObject()->getPaymentMethod() ? $this->getModelObject()->getPaymentMethod()->getName() : $result;
             break;
         case 'type':
             $list = \XLite\Model\Payment\BackendTransaction::getTypes();
             $result = $list[$result];
             break;
         case 'status':
             $list = \XLite\Model\Payment\Transaction::getStatuses();
             $result = $list[$result];
             break;
         case 'value':
             $result = static::formatPrice($result, $this->getModelObject()->getCurrency());
             break;
         case 'note':
             if (!$result) {
                 $result = static::t('n/a');
             }
             break;
         default:
     }
     return $result;
 }