Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/*******************************************************************************
3
 *  Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *
6
 *  You may not use this file except in compliance with the License.
7
 *  You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
 *  CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
 *  specific language governing permissions and limitations under the License.
11
 * *****************************************************************************
12
 */
13
 
14
 
15
/**
16
 *  @see CheckoutByAmazon_Service_Model
17
 */
18
require_once ('CheckoutByAmazon/Service/Model.php');
19
 
20
 
21
 
22
/**
23
 * CheckoutByAmazon_Service_Model_SetContractChargesResponse
24
 *
25
 * Properties:
26
 * <ul>
27
 *
28
 * <li>ResponseMetadata: CheckoutByAmazon_Service_Model_ResponseMetadata</li>
29
 *
30
 * </ul>
31
 */
32
class CheckoutByAmazon_Service_Model_SetContractChargesResponse extends CheckoutByAmazon_Service_Model
33
{
34
 
35
 
36
    /**
37
     * Construct new CheckoutByAmazon_Service_Model_SetContractChargesResponse
38
     *
39
     * @param mixed $data DOMElement or Associative Array to construct from.
40
     *
41
     * Valid properties:
42
     * <ul>
43
     *
44
     * <li>ResponseMetadata: CheckoutByAmazon_Service_Model_ResponseMetadata</li>
45
     *
46
     * </ul>
47
     */
48
    public function __construct($data = null)
49
    {
50
        $this->_fields = array (
51
        'ResponseMetadata' => array('FieldValue' => null, 'FieldType' => 'CheckoutByAmazon_Service_Model_ResponseMetadata'),
52
        );
53
        parent::__construct($data);
54
    }
55
 
56
 
57
    /**
58
     * Construct CheckoutByAmazon_Service_Model_SetContractChargesResponse from XML string
59
     *
60
     * @param string $xml XML string to construct from
61
     * @return CheckoutByAmazon_Service_Model_SetContractChargesResponse
62
     */
63
    public static function fromXML($xml)
64
    {
65
        $dom = new DOMDocument();
66
        $dom->loadXML($xml);
67
        $xpath = new DOMXPath($dom);
68
    	$xpath->registerNamespace('a','http://payments.amazon.com/checkout/v2/2010-08-31/');
69
        $response = $xpath->query('//a:SetContractChargesResponse');
70
        if ($response->length == 1) {
71
            return new CheckoutByAmazon_Service_Model_SetContractChargesResponse(($response->item(0)));
72
        } else {
73
            throw new Exception ("Unable to construct CheckoutByAmazon_Service_Model_SetContractChargesResponse from provided XML.
74
                                  Make sure that SetContractChargesResponse is a root element");
75
        }
76
 
77
    }
78
 
79
    /**
80
     * Gets the value of the ResponseMetadata.
81
     *
82
     * @return ResponseMetadata ResponseMetadata
83
     */
84
    public function getResponseMetadata()
85
    {
86
        return $this->_fields['ResponseMetadata']['FieldValue'];
87
    }
88
 
89
    /**
90
     * Sets the value of the ResponseMetadata.
91
     *
92
     * @param ResponseMetadata ResponseMetadata
93
     * @return void
94
     */
95
    public function setResponseMetadata($value)
96
    {
97
        $this->_fields['ResponseMetadata']['FieldValue'] = $value;
98
        return;
99
    }
100
 
101
 
102
    /**
103
     * Checks if ResponseMetadata  is set
104
     *
105
     * @return bool true if ResponseMetadata property is set
106
     */
107
    public function isSetResponseMetadata()
108
    {
109
        return !is_null($this->_fields['ResponseMetadata']['FieldValue']);
110
 
111
    }
112
 
113
 
114
 
115
    /**
116
     * XML Representation for this object
117
     *
118
     * @return string XML for this object
119
     */
120
    public function toXML()
121
    {
122
        $xml = "";
123
        $xml .= "<SetContractChargesResponse xmlns=\"http://payments.amazon.com/checkout/v2/2010-08-31/\">";
124
        $xml .= $this->_toXMLFragment();
125
        $xml .= "</SetContractChargesResponse>";
126
        return $xml;
127
    }
128
 
129
}
130
?>