openstamanager/modules/preventivi/src/Components/RelationTrait.php

24 lines
380 B
PHP

<?php
namespace Modules\Preventivi\Components;
use Modules\Preventivi\Preventivo;
trait RelationTrait
{
public function getParentID()
{
return 'idpreventivo';
}
public function parent()
{
return $this->belongsTo(Preventivo::class, $this->getParentID());
}
public function preventivo()
{
return $this->parent();
}
}