invoiceninja/app/models/AccountGateway.php

24 lines
529 B
PHP
Raw Normal View History

2013-11-26 14:45:07 +02:00
<?php
2014-01-02 10:27:48 +02:00
class AccountGateway extends EntityModel
2013-11-26 14:45:07 +02:00
{
2015-01-11 14:30:08 +02:00
public function gateway()
{
return $this->belongsTo('Gateway');
}
public function getCreditcardTypes()
{
$flags = unserialize(CREDIT_CARDS);
$arrayOfImages = [];
2015-01-11 14:30:08 +02:00
foreach ($flags as $card => $name) {
if (($this->accepted_credit_cards & $card) == $card) {
$arrayOfImages[] = ['source' => asset($name['card']), 'alt' => $name['text']];
2015-01-11 14:30:08 +02:00
}
}
return $arrayOfImages;
}
2015-01-11 14:30:08 +02:00
}