mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Add groups, and the option for objects to be linked to one (or more) groups. #3128
This commit is contained in:
21
app/Models/ObjectGroup.php
Normal file
21
app/Models/ObjectGroup.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ObjectGroup
|
||||
*/
|
||||
class ObjectGroup extends Model
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany
|
||||
*/
|
||||
public function piggyBanks()
|
||||
{
|
||||
return $this->morphedByMany(PiggyBank::class, 'object_groupable');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user