mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-30 12:43:57 -06:00
49 lines
2.0 KiB
PHP
49 lines
2.0 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Budget
|
|
*
|
|
* @property integer $id
|
|
* @property \Carbon\Carbon $created_at
|
|
* @property \Carbon\Carbon $updated_at
|
|
* @property string $name
|
|
* @property integer $user_id
|
|
* @property string $class
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
|
|
* @property-read \User $user
|
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereId($value)
|
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereName($value)
|
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereUserId($value)
|
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereClass($value)
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
|
|
*/
|
|
class Budget extends Component
|
|
{
|
|
public static $factory
|
|
= [
|
|
'name' => 'string',
|
|
'user_id' => 'factory|User',
|
|
'class' => 'Budget'
|
|
];
|
|
protected $isSubclass = true;
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function limits()
|
|
{
|
|
return $this->hasMany('Limit', 'component_id');
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
|
*/
|
|
public function transactionjournals()
|
|
{
|
|
return $this->belongsToMany('TransactionJournal', 'component_transaction_journal', 'component_id');
|
|
}
|
|
|
|
}
|