Piggy bank supports notes (#350)

This commit is contained in:
James Cole
2016-10-22 10:13:49 +02:00
parent 091f6e918b
commit e4d249e73c
8 changed files with 158 additions and 2 deletions

View File

@@ -56,6 +56,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @mixin \Eloquent
* @property boolean $active
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereActive($value)
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Note[] $notes
*/
class PiggyBank extends Model
{
@@ -146,6 +147,14 @@ class PiggyBank extends Model
}
/**
* Get all of the piggy bank's notes.
*/
public function notes()
{
return $this->morphMany('FireflyIII\Models\Note', 'noteable');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/