mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-07 06:33:57 -06:00
32 lines
747 B
PHP
32 lines
747 B
PHP
<?php
|
|
|
|
|
|
class Component extends Firefly\Database\SingleTableInheritanceEntity
|
|
{
|
|
|
|
public static $rules
|
|
= [
|
|
'user_id' => 'exists:users,id|required',
|
|
'name' => 'required|between:1,255',
|
|
'class' => 'required',
|
|
'component_type_id' => 'required|exists:component_types,id'
|
|
];
|
|
protected $table = 'components';
|
|
protected $subclassField = 'class';
|
|
|
|
public function transactions()
|
|
{
|
|
return $this->belongsToMany('Transaction');
|
|
}
|
|
|
|
public function transactionjournals()
|
|
{
|
|
return $this->belongsToMany('TransactionJournal');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo('User');
|
|
}
|
|
|
|
}
|