Editar Brokers y sus contratos
This commit is contained in:
@ -17,7 +17,8 @@ class Broker extends Ideal\Service
|
||||
protected Repository\Proyecto\Broker $brokerRepository,
|
||||
protected Repository\Proyecto\Broker\Data $dataRepository,
|
||||
protected Repository\Proyecto\Broker\Contact $contactRepository,
|
||||
protected Repository\Proyecto\Broker\Contract $contractRepository)
|
||||
protected Repository\Proyecto\Broker\Contract $contractRepository,
|
||||
protected Service\Proyecto\Broker\Contract $contractService)
|
||||
{
|
||||
parent::__construct($logger);
|
||||
}
|
||||
@ -115,8 +116,8 @@ class Broker extends Ideal\Service
|
||||
->setArgs(['broker_rut' => $broker->rut])
|
||||
->setCallable([$this->dataRepository, 'fetchByBroker']))
|
||||
->addFactory('contracts', (new Factory())
|
||||
->setArgs(['brokerRut' => $broker->rut])
|
||||
->setCallable([$this->contractRepository, 'fetchByBroker']));
|
||||
->setArgs(['broker_rut' => $broker->rut])
|
||||
->setCallable([$this->contractService, 'getByBroker']));
|
||||
|
||||
return $broker;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ class Contract extends Ideal\Service
|
||||
{
|
||||
try {
|
||||
$contract = $this->contractRepository->fetchById($id);
|
||||
$this->contractRepository->remove($contract->id);
|
||||
$this->contractRepository->remove($contract);
|
||||
return $contract;
|
||||
} catch (PDOException | Implement\Exception\EmptyResult $exception) {
|
||||
throw new ServiceAction\Delete(__CLASS__, $exception);
|
||||
@ -145,9 +145,6 @@ class Contract extends Ideal\Service
|
||||
$contract->addFactory('states', (new Implement\Repository\Factory())
|
||||
->setCallable([$this->stateRepository, 'fetchByContract'])
|
||||
->setArgs(['contract_id' => $contract->id]));
|
||||
/*$contract->addFactory('currentState', (new Implement\Repository\Factory())
|
||||
->setCallable([$this->stateRepository, 'fetchActiveByContract'])
|
||||
->setArgs(['contract_id' => $contract->id]));*/
|
||||
return $contract;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user