mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 12:30:35 +01:00
32 lines
565 B
PHP
32 lines
565 B
PHP
<?php
|
|
|
|
namespace Modules\Interventi;
|
|
|
|
use Common\Row;
|
|
|
|
class Riga extends Row
|
|
{
|
|
protected $table = 'in_righe_interventi';
|
|
|
|
/**
|
|
* Crea una nuova riga collegata ad un intervento.
|
|
*
|
|
* @param Intervento $intervento
|
|
*
|
|
* @return self
|
|
*/
|
|
public static function make(Intervento $intervento)
|
|
{
|
|
$model = parent::make();
|
|
|
|
$model->intervento()->associate($intervento);
|
|
|
|
return $model;
|
|
}
|
|
|
|
public function intervento()
|
|
{
|
|
return $this->belongsTo(Intervento::class, 'idintervento');
|
|
}
|
|
}
|