Example #1
1
 /**
  * @param SimpleXMLElement $xmlRecord
  *
  * @return DTO\Account
  */
 protected function getAccount(SimpleXMLElement $xmlRecord)
 {
     if (isset($xmlRecord->Acct->Id->IBAN)) {
         return new DTO\IbanAccount(new Iban((string) $xmlRecord->Acct->Id->IBAN));
     }
     if (isset($xmlRecord->Acct->Id->BBAN)) {
         return new DTO\BBANAccount((string) $xmlRecord->Acct->Id->BBAN);
     }
     if (isset($xmlRecord->Acct->Id->UPIC)) {
         return new DTO\UPICAccount((string) $xmlRecord->Acct->Id->UPIC);
     }
     if (isset($xmlRecord->Acct->Id->PrtryAcct)) {
         return new DTO\ProprietaryAccount((string) $xmlRecord->Acct->Id->PrtryAcct->Id);
     }
     if (isset($xmlRecord->Acct->Id->Othr)) {
         $xmlOtherIdentification = $xmlRecord->Acct->Id->Othr;
         $otherAccount = new DTO\OtherAccount((string) $xmlOtherIdentification->Id);
         if (isset($xmlOtherIdentification->SchmeNm)) {
             if (isset($xmlOtherIdentification->SchmeNm->Cd)) {
                 $otherAccount->setSchemeName((string) $xmlOtherIdentification->SchmeNm->Cd);
             }
             if (isset($xmlOtherIdentification->SchmeNm->Prtry)) {
                 $otherAccount->setSchemeName((string) $xmlOtherIdentification->SchmeNm->Prtry);
             }
         }
         if (isset($xmlOtherIdentification->Issr)) {
             $otherAccount->setIssuer($xmlOtherIdentification->Issr);
         }
         return $otherAccount;
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function getRelatedPartyAccount(SimpleXMLElement $xmlRelatedPartyTypeAccount)
 {
     if (false === isset($xmlRelatedPartyTypeAccount->Id)) {
         return;
     }
     if (isset($xmlRelatedPartyTypeAccount->Id->IBAN) && ($ibanCode = (string) $xmlRelatedPartyTypeAccount->Id->IBAN)) {
         return new DTO\IbanAccount(new Iban($ibanCode));
     }
     if (false === isset($xmlRelatedPartyTypeAccount->Id->Othr)) {
         return;
     }
     $xmlOtherIdentification = $xmlRelatedPartyTypeAccount->Id->Othr;
     $otherAccount = new DTO\OtherAccount((string) $xmlOtherIdentification->Id);
     if (isset($xmlOtherIdentification->SchmeNm)) {
         if (isset($xmlOtherIdentification->SchmeNm->Cd)) {
             $otherAccount->setSchemeName((string) $xmlOtherIdentification->SchmeNm->Cd);
         }
         if (isset($xmlOtherIdentification->SchmeNm->Prtry)) {
             $otherAccount->setSchemeName((string) $xmlOtherIdentification->SchmeNm->Prtry);
         }
     }
     if (isset($xmlOtherIdentification->Issr)) {
         $otherAccount->setIssuer((string) $xmlOtherIdentification->Issr);
     }
     return $otherAccount;
 }