1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/Ninja/Repositories/AccountGatewayRepository.php
Holger Lösken 0fbda85a59 Code Refactoring
- Removed unused uses
- Type hinting for method parameters
- Removed commented code
- Introduced comments for classes and methods
- Short array syntax
2016-07-03 16:19:22 +00:00

25 lines
759 B
PHP

<?php namespace App\Ninja\Repositories;
use DB;
class AccountGatewayRepository extends BaseRepository
{
public function getClassName()
{
return 'App\Models\AccountGateway';
}
public function find($accountId)
{
$query = DB::table('account_gateways')
->join('gateways', 'gateways.id', '=', 'account_gateways.gateway_id')
->where('account_gateways.account_id', '=', $accountId);
if (!\Session::get('show_trash:gateway')) {
$query->where('account_gateways.deleted_at', '=', null);
}
return $query->select('account_gateways.id', 'account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at', 'account_gateways.gateway_id');
}
}