1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Ninja/Repositories/TokenRepository.php
2015-11-06 00:37:04 +02:00

28 lines
736 B
PHP

<?php namespace App\Ninja\Repositories;
use DB;
use Utils;
use Session;
use App\Models\Token;
use App\Ninja\Repositories\BaseRepository;
class TokenRepository extends BaseRepository
{
public function getClassName()
{
return 'App\Models\AccountToken';
}
public function find($accountId)
{
$query = DB::table('account_tokens')
->where('account_tokens.account_id', '=', $accountId);
if (!Session::get('show_trash:token')) {
$query->where('account_tokens.deleted_at', '=', null);
}
return $query->select('account_tokens.public_id', 'account_tokens.name', 'account_tokens.token', 'account_tokens.public_id', 'account_tokens.deleted_at');
}
}