Files
oficial/app/src/Service/Venta/Pie.php

31 lines
749 B
PHP
Raw Normal View History

<?php
namespace Incoviba\Service\Venta;
use Incoviba\Repository;
use Incoviba\Model;
class Pie
{
public function __construct(
protected Repository\Venta\Pie $pieRepository,
2023-09-13 18:51:46 -03:00
protected Cuota $cuotaService
) {}
public function getById(int $pie_id): Model\Venta\Pie
{
$pie = $this->pieRepository->fetchById($pie_id);
2023-09-13 18:51:46 -03:00
$pie->cuotasArray = $this->cuotaService->getVigenteByPie($pie_id);
return $pie;
}
2023-09-13 18:51:46 -03:00
public function add(array $data): Model\Venta\Pie
{
$pie = $this->pieRepository->create($data);
return $this->pieRepository->save($pie);
}
public function addCuota(array $data): Model\Venta\Cuota
{
return $this->cuotaService->add($data);
}
}