Skip to content

Commit

Permalink
WIP: Dolibarr V19 Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
BadPixxel committed Feb 22, 2024
1 parent 8f3a73f commit ac05be0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion splash/src/Objects/Invoice/StatusTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,18 @@ protected function setStatusFields(string $fieldName, $fieldData)
*/
protected function getInvoiceStatus(): int
{
//====================================================================//
// Manage Deprecation of status property
if (!property_exists($this->object, "status")
&& property_exists($this->object, "statut")
) {
return $this->object->statut;
}
if (property_exists($this->object, "statut")) {
/** @phpstan-ignore-next-line */
return $this->object->status ?? $this->object->statut;
}

return $this->object->status;
}

Expand All @@ -234,7 +246,7 @@ protected function setInvoiceStatus(int $status): void
{
$this->object->status = $status;
//====================================================================//
//
// Manage Deprecation of status property
if (property_exists($this->object, "statut")) {
$this->object->statut = $status;
}
Expand Down

0 comments on commit ac05be0

Please sign in to comment.