precioRepository->fetchByProyecto($proyecto_id); foreach ($precios as &$precio) { $precio->estados = $this->estadoPrecioRepository->fetchByPrecio($precio->id); $precio->current = $this->estadoPrecioRepository->fetchCurrentByPrecio($precio->id); } return $precios; } public function getByUnidad(int $unidad_id): Model\Venta\Precio { $precio = $this->precioRepository->fetchByUnidad($unidad_id); $precio->estados = $this->estadoPrecioRepository->fetchByPrecio($precio->id); $precio->current = $this->estadoPrecioRepository->fetchCurrentByPrecio($precio->id); return $precio; } }