2024-06-18
This commit is contained in:
27
app/src/Controller/Inmobiliarias/Proveedores.php
Normal file
27
app/src/Controller/Inmobiliarias/Proveedores.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace Incoviba\Controller\Inmobiliarias;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Incoviba\Common\Implement\Exception\EmptyResult;
|
||||
use Incoviba\Common\Alias\View;
|
||||
use Incoviba\Repository;
|
||||
use Incoviba\Service;
|
||||
|
||||
class Proveedores
|
||||
{
|
||||
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
||||
Service\Sociedad $sociedadService,
|
||||
Repository\Inmobiliaria\TipoSociedad $tipoSociedad): ResponseInterface
|
||||
{
|
||||
$sociedades = [];
|
||||
try {
|
||||
$sociedades = $sociedadService->getAll('nombre');
|
||||
} catch (EmptyResult) {}
|
||||
$tiposSociedades = [];
|
||||
try {
|
||||
$tiposSociedades = $tipoSociedad->fetchAll('descripcion');
|
||||
} catch (EmptyResult) {}
|
||||
return $view->render($response, 'inmobiliarias.proveedores', compact('sociedades', 'tiposSociedades'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user