diff --git a/app/Models/Budget.php b/app/Models/Budget.php index d33cdad51f..98f22bab7e 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -22,21 +22,21 @@ use Watson\Validating\ValidatingTrait; /** * FireflyIII\Models\Budget * - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property integer $user_id - * @property boolean $active - * @property boolean $encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|BudgetLimit[] $budgetlimits - * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user - * @property string $dateFormatted - * @property string $budgeted - * @property float $amount - * @property \Carbon\Carbon $date + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $name + * @property integer $user_id + * @property boolean $active + * @property boolean $encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|BudgetLimit[] $budgetlimits + * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user + * @property string $dateFormatted + * @property string $budgeted + * @property float $amount + * @property \Carbon\Carbon $date * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereUpdatedAt($value) @@ -46,7 +46,7 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereActive($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereEncrypted($value) * @mixin \Eloquent - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\LimitRepetition[] $limitrepetitions */ class Budget extends Model diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 93de3d0602..9b3c7066a6 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -18,12 +18,12 @@ use Illuminate\Database\Eloquent\SoftDeletes; * FireflyIII\Models\Configuration * * @mixin \Eloquent - * @property integer $id + * @property integer $id * @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property string $data + * @property string $name + * @property string $data * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Configuration whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Configuration whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Configuration whereUpdatedAt($value) @@ -35,9 +35,8 @@ class Configuration extends Model { use SoftDeletes; - protected $table = 'configuration'; - protected $dates = ['created_at', 'updated_at', 'deleted_at']; + protected $table = 'configuration'; /** * @param $value @@ -58,5 +57,4 @@ class Configuration extends Model } - } diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 4919142fa0..75e57de22d 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -40,9 +40,9 @@ use Illuminate\Database\Eloquent\Model; class PiggyBankRepetition extends Model { + protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate']; protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount']; protected $hidden = ['currentamount_encrypted']; - protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 15ddef16e6..d8884325b1 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -16,6 +16,7 @@ use FireflyIII\Exceptions\FireflyException; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Database\Eloquent\Model; use Log; + /** * FireflyIII\Models\Preference * @@ -54,7 +55,7 @@ class Preference extends Model try { $data = Crypt::decrypt($value); } catch (DecryptException $e) { - Log::error('Could not decrypt preference.', ['id' => $this->id,'name' => $this->name,'data' => $this->data]); + Log::error('Could not decrypt preference.', ['id' => $this->id, 'name' => $this->name, 'data' => $this->data]); throw new FireflyException('Could not decrypt preference #' . $this->id . '.'); } diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 491c7ad1d8..368a4f8d87 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -52,38 +52,6 @@ class Rule extends Model { use SoftDeletes; - /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function user() - { - return $this->belongsTo('FireflyIII\User'); - } - - /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function ruleGroup() - { - return $this->belongsTo('FireflyIII\Models\RuleGroup'); - } - - /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function ruleActions() - { - return $this->hasMany('FireflyIII\Models\RuleAction'); - } - - /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function ruleTriggers() - { - return $this->hasMany('FireflyIII\Models\RuleTrigger'); - } - /** * @param Rule $value * @@ -99,4 +67,36 @@ class Rule extends Model throw new NotFoundHttpException; } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function ruleActions() + { + return $this->hasMany('FireflyIII\Models\RuleAction'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function ruleGroup() + { + return $this->belongsTo('FireflyIII\Models\RuleGroup'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function ruleTriggers() + { + return $this->hasMany('FireflyIII\Models\RuleTrigger'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + return $this->belongsTo('FireflyIII\User'); + } + } diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index c02d11ebec..d10b736600 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -48,23 +48,6 @@ class RuleGroup extends Model protected $fillable = ['user_id', 'order', 'title', 'description', 'active']; - /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function user() - { - return $this->belongsTo('FireflyIII\User'); - } - - - /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function rules() - { - return $this->hasMany('FireflyIII\Models\Rule'); - } - /** * @param RuleGroup $value * @@ -79,4 +62,20 @@ class RuleGroup extends Model } throw new NotFoundHttpException; } + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function rules() + { + return $this->hasMany('FireflyIII\Models\Rule'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + return $this->belongsTo('FireflyIII\User'); + } }