mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
More code.
This commit is contained in:
@@ -21,14 +21,9 @@ class Account extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\AccountType');
|
||||
}
|
||||
|
||||
public function user()
|
||||
public function getDates()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
|
||||
public function transactions()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\Transaction');
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function scopeAccountTypeIn(EloquentBuilder $query, array $types)
|
||||
@@ -40,9 +35,14 @@ class Account extends Model
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
public function transactions()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
return $this->hasMany('FireflyIII\Models\Transaction');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,13 +16,14 @@ class AccountMeta extends Model
|
||||
return json_decode($value);
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ class AccountType extends Model
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\Account');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Bill extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'date'];
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
@@ -14,10 +19,6 @@ class Bill extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','date'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -11,6 +11,11 @@ class Budget extends Model
|
||||
return $this->hasMany('FireflyIII\Models\BudgetLimit');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function limitrepetitions()
|
||||
{
|
||||
return $this->hasManyThrough('FireflyIII\Models\LimitRepetition', 'BudgetLimit', 'budget_id');
|
||||
@@ -25,10 +30,6 @@ class Budget extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -10,13 +10,14 @@ class BudgetLimit extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\Budget');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate'];
|
||||
}
|
||||
|
||||
public function limitrepetitions()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\LimitRepetition');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','startdate'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Category extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
||||
@@ -14,9 +19,5 @@ class Category extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,6 +7,6 @@ class Component extends Model
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
}
|
||||
|
@@ -9,9 +9,10 @@ class LimitRepetition extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','startdate','enddate'];
|
||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,6 +10,11 @@ class PiggyBank extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\Account');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
||||
}
|
||||
|
||||
public function piggyBankEvents()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
||||
@@ -24,8 +29,4 @@ class PiggyBank extends Model
|
||||
{
|
||||
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at','startdate','targetdate'];
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class PiggyBankEvent extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'date'];
|
||||
}
|
||||
|
||||
public function piggyBank()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||
@@ -14,9 +19,5 @@ class PiggyBankEvent extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','date'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,13 +5,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class PiggyBankRepetition extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate', 'targetdate'];
|
||||
}
|
||||
|
||||
public function piggyBank()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','startdate','targetdate'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,11 +5,18 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Preference extends Model
|
||||
{
|
||||
|
||||
protected $fillable = ['user_id', 'data', 'name'];
|
||||
|
||||
public function getDataAttribute($value)
|
||||
{
|
||||
return json_decode($value);
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
@@ -19,9 +26,5 @@ class Preference extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Reminder extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||
}
|
||||
|
||||
public function remindersable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
@@ -14,9 +19,5 @@ class Reminder extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','startdate','enddate'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,12 +10,13 @@ class Transaction extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\Account');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionJournal()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
}
|
||||
|
@@ -5,12 +5,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TransactionCurrency extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TransactionGroup extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
|
||||
@@ -14,9 +19,5 @@ class TransactionGroup extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ class TransactionJournal extends Model
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'date','deleted_at'];
|
||||
return ['created_at', 'updated_at', 'date', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function getDescriptionAttribute($value)
|
||||
|
@@ -5,12 +5,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TransactionType extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user