mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add withData() to PaymentHash
This commit is contained in:
parent
7dd7a6e4b1
commit
2501654fec
@ -21,7 +21,6 @@ class PaymentHash extends Model
|
|||||||
'data' => 'object',
|
'data' => 'object',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
public function invoices()
|
public function invoices()
|
||||||
{
|
{
|
||||||
return $this->data->invoices;
|
return $this->data->invoices;
|
||||||
@ -41,4 +40,12 @@ class PaymentHash extends Model
|
|||||||
{
|
{
|
||||||
return $this->belongsTo(Invoice::class, 'fee_invoice_id', 'id');
|
return $this->belongsTo(Invoice::class, 'fee_invoice_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function withData(string $property, $value): PaymentHash
|
||||||
|
{
|
||||||
|
$this->data = array_merge((array) $this->data, [$property => $value]);
|
||||||
|
$this->save();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user