/** * Convert the reference number into a RentRecoveryPlusReference object. * * @param mixed $referenceNumber * @return mixed|RentRecoveryPlusReference * @throws \LogicException */ public function reverseTransform($referenceNumber) { // Attempt to retrieve the corresponding applicationUuid from the session. if (false === ($referencingApplication = $this->sessionHolder->getReferenceFromSession($referenceNumber, $this->getCurrentAsn()))) { return null; } // Now create (and return) a RentRecoveryPlusReference and set $referencingApplication as its parent return $this->createRentRecoveryPlusReference($referencingApplication); }
/** * Verify that the number of days between now and date reference was completed does not exceed the limit. * * {@inheritdoc} */ public function verify($referenceNumber, $data = array()) { if (!array_key_exists('current_asn', $data)) { throw new \LogicException('current_asn key does not exist in $data array'); } $reference = $this->sessionHolder->getReferenceFromSession($referenceNumber, $data['current_asn']); if (self::MAX_DAYS_ALLOWED < $this->calculateDaysSinceCompletion($reference)) { return false; } return true; }
/** * {@inheritdoc} */ public function verify($referenceNumber, $data = array()) { if (!array_key_exists('current_asn', $data)) { throw new \LogicException('current_asn key does not exist in $data array'); } $this->status = $this->sessionHolder->getReferenceFromSession($referenceNumber, $data['current_asn'])->getStatus(); if (ApplicationStatuses::COMPLETE != $this->status) { return false; } return true; }