2020-06-04 23:25:39 -05:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace FireflyIII\Models;
|
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ObjectGroup
|
2020-06-06 14:23:26 -05:00
|
|
|
*
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
|
2020-06-07 04:31:01 -05:00
|
|
|
* @property-read int|null $piggy_banks_count
|
2020-06-06 14:23:26 -05:00
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup newModelQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup newQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup query()
|
|
|
|
* @mixin \Eloquent
|
2020-06-07 04:31:01 -05:00
|
|
|
* @property int $id
|
|
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
|
* @property string|null $deleted_at
|
|
|
|
* @property string $title
|
|
|
|
* @property int $order
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup whereDeletedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup whereOrder($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup whereTitle($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\ObjectGroup whereUpdatedAt($value)
|
2020-06-04 23:25:39 -05:00
|
|
|
*/
|
|
|
|
class ObjectGroup extends Model
|
|
|
|
{
|
2020-06-07 04:31:01 -05:00
|
|
|
protected $fillable = ['title', 'order'];
|
2020-06-04 23:25:39 -05:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\MorphToMany
|
|
|
|
*/
|
|
|
|
public function piggyBanks()
|
|
|
|
{
|
|
|
|
return $this->morphedByMany(PiggyBank::class, 'object_groupable');
|
|
|
|
}
|
|
|
|
}
|