2018-10-16 13:42:43 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @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)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 05:32:07 +02:00
|
|
|
*/
|
2018-10-16 13:42:43 +02:00
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class Bank.
|
2023-03-08 08:33:42 +01:00
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property string|null $name
|
|
|
|
* @property string|null $remote_id
|
|
|
|
* @property int $bank_library_id
|
|
|
|
* @property string|null $config
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel company()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank newModelQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank newQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank query()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank whereBankLibraryId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank whereConfig($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank whereName($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Bank whereRemoteId($value)
|
|
|
|
* @mixin \Eloquent
|
2018-10-16 13:42:43 +02:00
|
|
|
*/
|
2019-09-12 03:28:41 +02:00
|
|
|
class Bank extends StaticModel
|
2018-10-16 13:42:43 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $finance
|
|
|
|
*
|
|
|
|
* @return \App\Libraries\Bank
|
|
|
|
*/
|
|
|
|
public function getOFXBank($finance)
|
|
|
|
{
|
|
|
|
$config = json_decode($this->config);
|
|
|
|
|
|
|
|
return new \App\Libraries\Bank($finance, $config->fid, $config->url, $config->org);
|
|
|
|
}
|
2020-05-06 13:49:42 +02:00
|
|
|
|
|
|
|
public function getEntityType()
|
|
|
|
{
|
2020-09-06 11:38:10 +02:00
|
|
|
return self::class;
|
2020-05-06 13:49:42 +02:00
|
|
|
}
|
2018-10-16 13:42:43 +02:00
|
|
|
}
|