1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-03-13 01:30:11 +01:00

32 lines
534 B
PHP
Raw Normal View History

<?php
namespace Modules\Fatture;
use Common\Row;
2018-09-25 16:47:44 +02:00
class Riga extends Row
{
protected $table = 'co_righe_documenti';
2018-09-25 16:47:44 +02:00
/**
* Crea una nuova riga collegata ad una fattura.
*
* @param Fattura $fattura
*
* @return self
*/
2018-10-02 18:25:52 +02:00
public static function make(Fattura $fattura)
{
2018-10-02 18:25:52 +02:00
$model = parent::make();
2018-09-25 16:47:44 +02:00
$model->fattura()->associate($fattura);
2018-09-25 11:55:52 +02:00
2018-09-25 16:47:44 +02:00
return $model;
}
2018-08-09 10:14:26 +02:00
2018-09-25 11:55:52 +02:00
public function fattura()
2018-08-09 10:14:26 +02:00
{
2018-09-25 11:55:52 +02:00
return $this->belongsTo(Fattura::class, 'iddocumento');
2018-08-09 10:14:26 +02:00
}
}