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 2011 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_CreatePurchaseContractResponse
24
 *
25
 * Properties:
26
 * <ul>
27
 *
28
 * <li>CreatePurchaseContractResult: CheckoutByAmazon_Service_Model_CreatePurchaseContractResult</li>
29
 * <li>ResponseMetadata: CheckoutByAmazon_Service_Model_ResponseMetadata</li>
30
 *
31
 * </ul>
32
 */
33
class CheckoutByAmazon_Service_Model_CreatePurchaseContractResponse extends CheckoutByAmazon_Service_Model
34
{
35
 
36
 
37
    /**
38
     * Construct new CheckoutByAmazon_Service_Model_CreatePurchaseContractResponse
39
     *
40
     * @param mixed $data DOMElement or Associative Array to construct from.
41
     *
42
     * Valid properties:
43
     * <ul>
44
     *
45
     * <li>CreatePurchaseContractResult: CheckoutByAmazon_Service_Model_CreatePurchaseContractResult</li>
46
     * <li>ResponseMetadata: CheckoutByAmazon_Service_Model_ResponseMetadata</li>
47
     *
48
     * </ul>
49
     */
50
    public function __construct($data = null)
51
    {
52
        $this->_fields = array (
53
        'CreatePurchaseContractResult' => array('FieldValue' => null, 'FieldType' => 'CheckoutByAmazon_Service_Model_CreatePurchaseContractResult'),
54
        'ResponseMetadata' => array('FieldValue' => null, 'FieldType' => 'CheckoutByAmazon_Service_Model_ResponseMetadata'),
55
        );
56
        parent::__construct($data);
57
    }
58
 
59
 
60
    /**
61
     * Construct CheckoutByAmazon_Service_Model_CreatePurchaseContractResponse from XML string
62
     *
63
     * @param string $xml XML string to construct from
64
     * @return CheckoutByAmazon_Service_Model_CreatePurchaseContractResponse
65
     */
66
    public static function fromXML($xml)
67
    {
68
        $Dom = new DOMDocument();
69
        $Dom->loadXML($xml);
70
        $Xpath = new DOMXPath($Dom);
71
    	$Xpath->registerNamespace('a','http://payments.amazon.com/checkout/v2/2010-08-31/');
72
        $Response = $Xpath->query('//a:CreatePurchaseContractResponse');
73
        if ($Response->length == 1) {
74
            return new CheckoutByAmazon_Service_Model_CreatePurchaseContractResponse(($Response->item(0)));
75
        } else {
76
            throw new Exception ("Unable to construct CheckoutByAmazon_Service_Model_CreatePurchaseContractResponse from provided XML.
77
                                  Make sure that CreatePurchaseContractResponse is a root element");
78
        }
79
 
80
    }
81
 
82
    /**
83
     * Gets the value of the CreatePurchaseContractResult.
84
     *
85
     * @return CreatePurchaseContractResult CreatePurchaseContractResult
86
     */
87
    public function getCreatePurchaseContractResult()
88
    {
89
        return $this->_fields['CreatePurchaseContractResult']['FieldValue'];
90
    }
91
 
92
    /**
93
     * Sets the value of the CreatePurchaseContractResult.
94
     *
95
     * @param CreatePurchaseContractResult CreatePurchaseContractResult
96
     * @return void
97
     */
98
    public function setCreatePurchaseContractResult($value)
99
    {
100
        $this->_fields['CreatePurchaseContractResult']['FieldValue'] = $value;
101
        return;
102
    }
103
 
104
 
105
    /**
106
     * Checks if CreatePurchaseContractResult  is set
107
     *
108
     * @return bool true if CreatePurchaseContractResult property is set
109
     */
110
    public function isSetCreatePurchaseContractResult()
111
    {
112
        return !is_null($this->_fields['CreatePurchaseContractResult']['FieldValue']);
113
 
114
    }
115
 
116
    /**
117
     * Gets the value of the ResponseMetadata.
118
     *
119
     * @return ResponseMetadata ResponseMetadata
120
     */
121
    public function getResponseMetadata()
122
    {
123
        return $this->_fields['ResponseMetadata']['FieldValue'];
124
    }
125
 
126
    /**
127
     * Sets the value of the ResponseMetadata.
128
     *
129
     * @param ResponseMetadata ResponseMetadata
130
     * @return void
131
     */
132
    public function setResponseMetadata($value)
133
    {
134
        $this->_fields['ResponseMetadata']['FieldValue'] = $value;
135
        return;
136
    }
137
 
138
 
139
    /**
140
     * Checks if ResponseMetadata  is set
141
     *
142
     * @return bool true if ResponseMetadata property is set
143
     */
144
    public function isSetResponseMetadata()
145
    {
146
        return !is_null($this->_fields['ResponseMetadata']['FieldValue']);
147
 
148
    }
149
 
150
 
151
    /**
152
     * XML Representation for this object
153
     *
154
     * @return string XML for this object
155
     */
156
    public function toXML()
157
    {
158
        $xml = "";
159
        $xml .= "<CreatePurchaseContractResponse xmlns=\"http://payments.amazon.com/checkout/v2/2010-08-31/\">";
160
        $xml .= $this->_toXMLFragment();
161
        $xml .= "</CreatePurchaseContractResponse>";
162
        return $xml;
163
    }
164
 
165
}
166
?>