25 lines
496 B
PHP
25 lines
496 B
PHP
<?php
|
|
namespace Incoviba\Model\Proyecto;
|
|
|
|
use JsonSerializable;
|
|
|
|
class Superficie implements JsonSerializable
|
|
{
|
|
public float $sobre_nivel;
|
|
public float $bajo_nivel;
|
|
|
|
public function total(): float
|
|
{
|
|
return $this->bajo_nivel + $this->sobre_nivel;
|
|
}
|
|
|
|
public function jsonSerialize(): mixed
|
|
{
|
|
return [
|
|
'sobre_nivel' => $this->sobre_nivel,
|
|
'bajo_nivel' => $this->bajo_nivel,
|
|
'total' => $this->total()
|
|
];
|
|
}
|
|
}
|