src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Model/CaptureNotification.php
public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:CaptureNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_CaptureNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_CaptureNotification" .
                "from provided XML. Make sure that CaptureNotification" .
                "is a root element"
            );
        }
    }
public static function fromXML($xml)
    {
        $dom = new DOMDocument();
        $dom->loadXML($xml);
        $xpath = new DOMXPath($dom);
        $xpath->registerNamespace('a', self::getNamespace());
        $response = $xpath->query('//a:CaptureNotification');
        if ($response->length == 1) {
            return 
                new OffAmazonPaymentsNotifications_Model_CaptureNotification(
                    $response->item(0)
                );
        } else {
            throw new Exception(
                "Unable to construct " .
                "OffAmazonPaymentsNotifications_Model_CaptureNotification" .
                "from provided XML. Make sure that CaptureNotification" .
                "is a root element"
            );
        }
    }
public static function fromXML ( $ xml ) { $ dom = new DOMDocument ( ) ; $ dom -> loadXML ( $ xml ) ; $ xpath = new DOMXPath ( $ dom ) ; $ xpath -> registerNamespace ( 'a' , self :: getNamespace ( ) ) ; $ response = $ xpath -> query ( '//a:CaptureNotification' ) ; if ( $ response -> length == 1 ) { return new OffAmazonPaymentsNotifications_Model_CaptureNotification ( $ response -> item ( 0 ) ) ; } else { throw new Exception ( "Unable to construct " . "OffAmazonPaymentsNotifications_Model_CaptureNotification" . "from provided XML. Make sure that CaptureNotification" . "is a root element" ) ; } }
Construct OffAmazonPaymentsNotifications_Model_CaptureNotification
from XML string

@param string $xml XML string to construct from

@return OffAmazonPaymentsNotifications_Model_CaptureNotification
Construct OffAmazonPaymentsNotifications_Model_CaptureNotification from XML string