1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Models/BankIntegration.php

101 lines
3.2 KiB
PHP
Raw Normal View History

2022-08-05 06:25:06 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
2022-08-05 06:25:06 +02:00
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Models;
2022-08-11 06:19:35 +02:00
use Illuminate\Database\Eloquent\SoftDeletes;
2023-03-08 08:33:42 +01:00
/**
* App\Models\BankIntegration
*
* @property int $id
* @property int $account_id
* @property int $company_id
* @property int $user_id
* @property string $provider_name
* @property int $provider_id
* @property int $bank_account_id
* @property string|null $bank_account_name
* @property string|null $bank_account_number
* @property string|null $bank_account_status
* @property string|null $bank_account_type
2023-08-01 14:36:04 +02:00
* @property float $balance
* @property int|null $currency
2023-03-08 08:33:42 +01:00
* @property string $nickname
* @property string|null $from_date
2023-08-01 14:36:04 +02:00
* @property bool $is_deleted
2023-03-08 08:33:42 +01:00
* @property int|null $created_at
* @property int|null $updated_at
* @property int|null $deleted_at
* @property bool $disabled_upstream
* @property bool $auto_sync
2023-03-08 08:33:42 +01:00
* @property-read \App\Models\Account $account
* @property-read \App\Models\Company $company
* @property-read mixed $hashed_id
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
* @property-read int|null $transactions_count
* @property-read \App\Models\User $user
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
* @method static \Database\Factories\BankIntegrationFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration filter(\App\Filters\QueryFilters $filters)
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration query()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration withoutTrashed()
2023-03-16 05:20:38 +01:00
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\BankTransaction> $transactions
2023-03-08 08:33:42 +01:00
* @mixin \Eloquent
*/
2022-08-05 06:25:06 +02:00
class BankIntegration extends BaseModel
{
2022-08-11 06:19:35 +02:00
use SoftDeletes;
2022-11-11 00:13:11 +01:00
use Filterable;
2022-08-05 06:25:06 +02:00
protected $fillable = [
2022-09-29 11:43:59 +02:00
'bank_account_name',
'provider_name',
'bank_account_number',
'bank_account_status',
'bank_account_type',
'balance',
'currency',
'from_date',
'auto_sync',
2022-08-05 06:25:06 +02:00
];
public function getEntityType()
{
return self::class;
}
public function company()
{
return $this->belongsTo(Company::class);
}
public function user()
{
return $this->belongsTo(User::class)->withTrashed();
}
public function account()
{
2022-09-14 10:52:17 +02:00
return $this->belongsTo(Account::class);
2022-08-05 06:25:06 +02:00
}
2022-08-12 03:40:35 +02:00
public function transactions()
{
return $this->hasMany(BankTransaction::class)->withTrashed();
}
2023-02-16 02:36:09 +01:00
}