/** * Get a guarantor ReferencingApplication from IRIS, attach it to a RentRecoveryPlusReference and return it. * * @param RentRecoveryPlusReference $tenant * @return RentRecoveryPlusReference */ private function createGuarantor(RentRecoveryPlusReference $tenant) { $guarantorCollection = $this->clientRegistry->getAgentContext()->getReferencingApplicationClient()->getReferencingApplicationGuarantors(array('referencingApplicationUuId' => $tenant->getParent()->getReferencingApplicationUuid())); // todo: Grab the first one for now - business will likely want to consider all Guarantors however. $guarantor = current($guarantorCollection->getAll()); $this->rrpGuarantor = new RentRecoveryPlusReference(); $this->rrpGuarantor->setParent($guarantor)->setDecisionDetails($this->decisionDetailsRetriever->getDecisionDetails($guarantor)); return $this->rrpGuarantor; }
/** * Takes a reference of type ReferencingApplication and sets it as a parent of a RentRecoveryPlusReference. * * @param ReferencingApplication $referenceToConvert * @return RentRecoveryPlusReference */ private function createRentRecoveryPlusReference(ReferencingApplication $referenceToConvert) { $decisionDetails = $this->decisionDetailsRetriever->getDecisionDetails($referenceToConvert); $this->convertedReference->setParent($referenceToConvert)->setDecisionDetails($decisionDetails); return $this->convertedReference; }