Ejemplo n.º 1
0
 /**
  * @param string|SimpleXMLElement $content
  *
  * @return \Realejo\Ofx\Banking\Banking
  */
 public static function parse($content)
 {
     // Verifica se é um string
     if (is_string($content)) {
         $content = \Realejo\Ofx\Parser::makeXML($content);
     }
     $banking = new Banking();
     // Verifica se existe o bloco de Banking
     $BANKMSGSRSV1 = $content->xpath('//BANKMSGSRSV1');
     if (count($BANKMSGSRSV1) == 1) {
         $banking->setStatement(self::parseBankMessage($content));
     }
     // Verifica se existe o bloco de Banking
     $CREDITCARDMSGSRSV1 = $content->xpath('//CREDITCARDMSGSRSV1');
     if (count($CREDITCARDMSGSRSV1) == 1) {
         $banking->setStatement(self::parseCreditcardMessage($content));
     }
     return $banking;
 }
Ejemplo n.º 2
0
 /**
  * Tests Getters ans Setters
  */
 public function testSettersGetters()
 {
     $this->assertInstanceOf('\\Realejo\\Ofx\\Banking\\Banking', $this->Banking->setStatement(new Statement()));
     $this->assertInstanceOf('\\Realejo\\Ofx\\Banking\\Statement', $this->Banking->getStatement());
 }