2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
2016-01-20 00:07:31 +01:00
|
|
|
|
2017-07-25 20:48:36 +02:00
|
|
|
use Crypt;
|
2016-01-20 00:07:31 +01:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
2017-01-30 20:40:43 +01:00
|
|
|
* Class BankAccount.
|
2016-07-03 18:11:58 +02:00
|
|
|
*/
|
2016-01-20 00:07:31 +01:00
|
|
|
class BankAccount extends EntityModel
|
|
|
|
{
|
|
|
|
use SoftDeletes;
|
2017-07-11 12:22:11 +02:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2016-01-20 00:07:31 +01:00
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
|
2017-07-11 12:22:11 +02:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $fillable = [
|
|
|
|
'bank_id',
|
|
|
|
'app_version',
|
|
|
|
'ofx_version',
|
|
|
|
];
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2016-01-20 00:07:31 +01:00
|
|
|
public function getEntityType()
|
|
|
|
{
|
|
|
|
return ENTITY_BANK_ACCOUNT;
|
|
|
|
}
|
|
|
|
|
2017-07-25 20:48:36 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getUsername()
|
|
|
|
{
|
|
|
|
return Crypt::decrypt($this->username);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $config
|
|
|
|
*/
|
|
|
|
public function setUsername($value)
|
|
|
|
{
|
|
|
|
$this->username = Crypt::encrypt($value);
|
|
|
|
}
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
2016-01-20 00:07:31 +01:00
|
|
|
public function bank()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\Bank');
|
|
|
|
}
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2016-01-26 21:22:33 +01:00
|
|
|
public function bank_subaccounts()
|
|
|
|
{
|
|
|
|
return $this->hasMany('App\Models\BankSubaccount');
|
|
|
|
}
|
2016-01-20 00:07:31 +01:00
|
|
|
}
|