Update references

This commit is contained in:
James Cole 2015-02-06 05:04:06 +01:00
parent 57691471bb
commit ddc3e82c14
21 changed files with 117 additions and 63 deletions

View File

@ -7,8 +7,22 @@ use Illuminate\Database\Eloquent\Model;
*
* @package FireflyIII\Models
*/
class Account extends Model {
class Account extends Model
{
//
public function accountMeta()
{
return $this->hasMany('AccountMeta');
}
public function accountType()
{
return $this->belongsTo('AccountType');
}
public function user()
{
return $this->belongsTo('User');
}
}

View File

@ -2,8 +2,23 @@
use Illuminate\Database\Eloquent\Model;
class AccountMeta extends Model {
class AccountMeta extends Model
{
//
public function account()
{
return $this->belongsTo('Account');
}
public function getDataAttribute($value)
{
return json_decode($value);
}
public function setDataAttribute($value)
{
$this->attributes['data'] = json_encode($value);
}
}

View File

@ -2,8 +2,12 @@
use Illuminate\Database\Eloquent\Model;
class AccountType extends Model {
class AccountType extends Model
{
//
public function accounts()
{
return $this->hasMany('Account');
}
}

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Bill extends Model {
class Bill extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Budget extends Model {
class Budget extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class BudgetLimit extends Model {
class BudgetLimit extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Category extends Model {
class Category extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Component extends Model {
class Component extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class LimitRepetition extends Model {
class LimitRepetition extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class PiggyBank extends Model {
class PiggyBank extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class PiggyBankEvent extends Model {
class PiggyBankEvent extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class PiggyBankRepetition extends Model {
class PiggyBankRepetition extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Preference extends Model {
class Preference extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Reminder extends Model {
class Reminder extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class Transaction extends Model {
class Transaction extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class TransactionCurrency extends Model {
class TransactionCurrency extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class TransactionGroup extends Model {
class TransactionGroup extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class TransactionJournal extends Model {
class TransactionJournal extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class TransactionRelation extends Model {
class TransactionRelation extends Model
{
//

View File

@ -2,7 +2,8 @@
use Illuminate\Database\Eloquent\Model;
class TransactionType extends Model {
class TransactionType extends Model
{
//

View File

@ -1,12 +1,13 @@
<?php namespace FireflyIII\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Model;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword;
@ -32,6 +33,9 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
protected $hidden = ['password', 'remember_token'];
public function accounts()
{
return $this->hasMany('Account');
}
}