invoiceninja/app/Models/GatewayType.php
2016-09-15 13:41:09 +03:00

35 lines
574 B
PHP

<?php namespace App\Models;
use Eloquent;
use Cache;
use Utils;
/**
* Class GatewayType
*/
class GatewayType extends Eloquent
{
/**
* @var bool
*/
public $timestamps = false;
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
public static function getAliasFromId($id)
{
return Utils::getFromCache($id, 'gatewayTypes')->alias;
}
public static function getIdFromAlias($alias)
{
return Cache::get('gatewayTypes')->where('alias', $alias)->first()->id;
}
}