mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 04:34:00 +00:00
Move from getDates to array dates.
This commit is contained in:
@@ -5,10 +5,10 @@ use Crypt;
|
|||||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Illuminate\Database\Query\Builder;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
use Illuminate\Database\Query\Builder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FireflyIII\Models\Account
|
* FireflyIII\Models\Account
|
||||||
@@ -41,12 +41,13 @@ class Account extends Model
|
|||||||
|
|
||||||
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
|
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
|
||||||
protected $hidden = ['virtual_balance_encrypted', 'encrypted'];
|
protected $hidden = ['virtual_balance_encrypted', 'encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
protected $rules
|
protected $rules
|
||||||
= [
|
= [
|
||||||
'user_id' => 'required|exists:users,id',
|
'user_id' => 'required|exists:users,id',
|
||||||
'account_type_id' => 'required|exists:account_types,id',
|
'account_type_id' => 'required|exists:account_types,id',
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'active' => 'required|boolean'
|
'active' => 'required|boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -126,15 +127,6 @@ class Account extends Model
|
|||||||
return $this->belongsTo('FireflyIII\Models\AccountType');
|
return $this->belongsTo('FireflyIII\Models\AccountType');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return string[]
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
|
@@ -24,9 +24,10 @@ class AccountMeta extends Model
|
|||||||
= [
|
= [
|
||||||
'account_id' => 'required|exists:accounts,id',
|
'account_id' => 'required|exists:accounts,id',
|
||||||
'name' => 'required|between:1,100',
|
'name' => 'required|between:1,100',
|
||||||
'data' => 'required'
|
'data' => 'required',
|
||||||
];
|
];
|
||||||
protected $table = 'account_meta';
|
protected $table = 'account_meta';
|
||||||
|
protected $dates = ['created_at', 'updated_at'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -48,14 +49,6 @@ class AccountMeta extends Model
|
|||||||
return json_decode($value);
|
return json_decode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
|
@@ -17,6 +17,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class AccountType extends Model
|
class AccountType extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $dates = ['created_at', 'updated_at'];
|
||||||
|
|
||||||
//
|
//
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
@@ -25,13 +27,4 @@ class AccountType extends Model
|
|||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Account');
|
return $this->hasMany('FireflyIII\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
/** @noinspection PhpMissingParentCallCommonInspection */
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -38,15 +38,7 @@ class Bill extends Model
|
|||||||
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',];
|
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',];
|
||||||
|
|
||||||
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
|
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'date'];
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'date'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
|
@@ -33,6 +33,7 @@ class Budget extends Model
|
|||||||
|
|
||||||
protected $fillable = ['user_id', 'name', 'active'];
|
protected $fillable = ['user_id', 'name', 'active'];
|
||||||
protected $hidden = ['encrypted'];
|
protected $hidden = ['encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'enddate'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
@@ -71,14 +72,6 @@ class Budget extends Model
|
|||||||
return $this->hasMany('FireflyIII\Models\BudgetLimit');
|
return $this->hasMany('FireflyIII\Models\BudgetLimit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'enddate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
|
@@ -22,6 +22,7 @@ class BudgetLimit extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $hidden = ['amount_encrypted'];
|
protected $hidden = ['amount_encrypted'];
|
||||||
|
protected $date = ['created_at', 'updated_at', 'startdate'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
@@ -31,14 +32,6 @@ class BudgetLimit extends Model
|
|||||||
return $this->belongsTo('FireflyIII\Models\Budget');
|
return $this->belongsTo('FireflyIII\Models\Budget');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'startdate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
|
@@ -29,6 +29,7 @@ class Category extends Model
|
|||||||
|
|
||||||
protected $fillable = ['user_id', 'name'];
|
protected $fillable = ['user_id', 'name'];
|
||||||
protected $hidden = ['encrypted'];
|
protected $hidden = ['encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
@@ -58,15 +59,6 @@ class Category extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return string[]
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
|
@@ -5,27 +5,10 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FireflyIII\Models\Component
|
* Class Component
|
||||||
*
|
*
|
||||||
* @property integer $id
|
* @package FireflyIII\Models
|
||||||
* @property Carbon $created_at
|
|
||||||
* @property Carbon $updated_at
|
|
||||||
* @property Carbon $deleted_at
|
|
||||||
* @property string $name
|
|
||||||
* @property integer $user_id
|
|
||||||
* @property string $class
|
|
||||||
*/
|
*/
|
||||||
class Component extends Model
|
class Component extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'name', 'class'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ class LimitRepetition extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $hidden = ['amount_encrypted'];
|
protected $hidden = ['amount_encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
@@ -30,14 +31,6 @@ class LimitRepetition extends Model
|
|||||||
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
|
@@ -36,6 +36,7 @@ class PiggyBank extends Model
|
|||||||
protected $fillable
|
protected $fillable
|
||||||
= ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate', 'remind_me', 'reminder_skip'];
|
= ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate', 'remind_me', 'reminder_skip'];
|
||||||
protected $hidden = ['targetamount_encrypted', 'encrypted'];
|
protected $hidden = ['targetamount_encrypted', 'encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
@@ -72,14 +73,6 @@ class PiggyBank extends Model
|
|||||||
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
|
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string[]
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param $value
|
* @param $value
|
||||||
|
@@ -21,15 +21,7 @@ class PiggyBankEvent extends Model
|
|||||||
|
|
||||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
|
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
|
||||||
protected $hidden = ['amount_encrypted'];
|
protected $hidden = ['amount_encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'date'];
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
/** @noinspection PhpMissingParentCallCommonInspection */
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'date'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
@@ -24,14 +24,7 @@ class PiggyBankRepetition extends Model
|
|||||||
|
|
||||||
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
|
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
|
||||||
protected $hidden = ['currentamount_encrypted'];
|
protected $hidden = ['currentamount_encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate'];
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'startdate', 'targetdate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
@@ -23,7 +23,7 @@ class Preference extends Model
|
|||||||
|
|
||||||
protected $fillable = ['user_id', 'data', 'name'];
|
protected $fillable = ['user_id', 'data', 'name'];
|
||||||
protected $hidden = ['data_encrypted', 'name_encrypted'];
|
protected $hidden = ['data_encrypted', 'name_encrypted'];
|
||||||
|
protected $dates = ['created_at', 'updated_at'];
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@@ -39,14 +39,6 @@ class Preference extends Model
|
|||||||
return json_decode($data);
|
return json_decode($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
|
@@ -41,8 +41,9 @@ class Tag extends Model
|
|||||||
'date' => 'date',
|
'date' => 'date',
|
||||||
'latitude' => 'numeric|min:-90|max:90',
|
'latitude' => 'numeric|min:-90|max:90',
|
||||||
'longitude' => 'numeric|min:-90|max:90',
|
'longitude' => 'numeric|min:-90|max:90',
|
||||||
'tagMode' => 'required|in:nothing,balancingAct,advancePayment'
|
'tagMode' => 'required|in:nothing,balancingAct,advancePayment',
|
||||||
];
|
];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'date'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
@@ -76,15 +77,6 @@ class Tag extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* @return string[]
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'date'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the model to the database.
|
* Save the model to the database.
|
||||||
*
|
*
|
||||||
|
@@ -33,8 +33,10 @@ class Transaction extends Model
|
|||||||
'account_id' => 'required|exists:accounts,id',
|
'account_id' => 'required|exists:accounts,id',
|
||||||
'transaction_journal_id' => 'required|exists:transaction_journals,id',
|
'transaction_journal_id' => 'required|exists:transaction_journals,id',
|
||||||
'description' => 'between:1,255',
|
'description' => 'between:1,255',
|
||||||
'amount' => 'required|numeric'
|
'amount' => 'required|numeric',
|
||||||
];
|
];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
|
|
||||||
use SoftDeletes, ValidatingTrait;
|
use SoftDeletes, ValidatingTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,14 +57,6 @@ class Transaction extends Model
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
|
@@ -25,14 +25,7 @@ class TransactionCurrency extends Model
|
|||||||
|
|
||||||
|
|
||||||
protected $fillable = ['name', 'code', 'symbol'];
|
protected $fillable = ['name', 'code', 'symbol'];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
@@ -22,13 +22,7 @@ class TransactionGroup extends Model
|
|||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
/**
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
@@ -24,13 +24,7 @@ class TransactionType extends Model
|
|||||||
const TRANSFER = 'Transfer';
|
const TRANSFER = 'Transfer';
|
||||||
const OPENING_BALANCE = 'Opening balance';
|
const OPENING_BALANCE = 'Opening balance';
|
||||||
|
|
||||||
/**
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getDates()
|
|
||||||
{
|
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
|
Reference in New Issue
Block a user