Model tests.

This commit is contained in:
James Cole
2014-08-09 19:10:31 +02:00
parent 0967ff9c7f
commit 8eeadffdeb
3 changed files with 126 additions and 6 deletions

View File

@@ -38,14 +38,9 @@ class Component extends Firefly\Database\SingleTableInheritanceEntity
protected $table = 'components';
protected $subclassField = 'class';
public function transactions()
{
return $this->belongsToMany('Transaction');
}
public function limits()
{
return $this->belongsTo('Limit');
return $this->hasMany('Limit');
}
public function transactionjournals()
@@ -53,6 +48,11 @@ class Component extends Firefly\Database\SingleTableInheritanceEntity
return $this->belongsToMany('TransactionJournal');
}
public function transactions()
{
return $this->belongsToMany('Transaction');
}
public function user()
{
return $this->belongsTo('User');