Listado de Precios para Contrato Broker
This commit is contained in:
@ -45,6 +45,18 @@ class Unidad extends Ideal\Model
|
||||
return $precio;
|
||||
}
|
||||
|
||||
protected bool $sold;
|
||||
public function sold(): bool
|
||||
{
|
||||
if (!isset($this->sold)) {
|
||||
$this->sold = false;
|
||||
try {
|
||||
$this->sold = $this->runFactory('sold') ?? false;
|
||||
} catch (EmptyResult) {}
|
||||
}
|
||||
return $this->sold;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
$output = array_merge(parent::jsonSerialize(), [
|
||||
@ -59,6 +71,7 @@ class Unidad extends Ideal\Model
|
||||
$output['precios'] = $this->precios;
|
||||
$output['current_precio'] = $this->currentPrecio;
|
||||
}
|
||||
$output['sold'] = $this->sold() ?? false;
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user