|
1 <?php |
|
2 |
|
3 /** |
|
4 * Zend Framework |
|
5 * |
|
6 * LICENSE |
|
7 * |
|
8 * This source file is subject to the new BSD license that is bundled |
|
9 * with this package in the file LICENSE.txt. |
|
10 * It is also available through the world-wide-web at this URL: |
|
11 * http://framework.zend.com/license/new-bsd |
|
12 * If you did not receive a copy of the license and are unable to |
|
13 * obtain it through the world-wide-web, please send an email |
|
14 * to license@zend.com so we can send you a copy immediately. |
|
15 * |
|
16 * @category Zend |
|
17 * @package Zend_Service |
|
18 * @subpackage Amazon |
|
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
21 * @version $Id: CustomerReview.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
22 */ |
|
23 |
|
24 |
|
25 /** |
|
26 * @category Zend |
|
27 * @package Zend_Service |
|
28 * @subpackage Amazon |
|
29 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
30 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
31 */ |
|
32 class Zend_Service_Amazon_CustomerReview |
|
33 { |
|
34 /** |
|
35 * @var string |
|
36 */ |
|
37 public $Rating; |
|
38 |
|
39 /** |
|
40 * @var string |
|
41 */ |
|
42 public $HelpfulVotes; |
|
43 |
|
44 /** |
|
45 * @var string |
|
46 */ |
|
47 public $CustomerId; |
|
48 |
|
49 /** |
|
50 * @var string |
|
51 */ |
|
52 public $TotalVotes; |
|
53 |
|
54 /** |
|
55 * @var string |
|
56 */ |
|
57 public $Date; |
|
58 |
|
59 /** |
|
60 * @var string |
|
61 */ |
|
62 public $Summary; |
|
63 |
|
64 /** |
|
65 * @var string |
|
66 */ |
|
67 public $Content; |
|
68 |
|
69 /** |
|
70 * Assigns values to properties relevant to CustomerReview |
|
71 * |
|
72 * @param DOMElement $dom |
|
73 * @return void |
|
74 */ |
|
75 public function __construct(DOMElement $dom) |
|
76 { |
|
77 $xpath = new DOMXPath($dom->ownerDocument); |
|
78 $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/2005-10-05'); |
|
79 foreach (array('Rating', 'HelpfulVotes', 'CustomerId', 'TotalVotes', 'Date', 'Summary', 'Content') as $el) { |
|
80 $result = $xpath->query("./az:$el/text()", $dom); |
|
81 if ($result->length == 1) { |
|
82 $this->$el = (string) $result->item(0)->data; |
|
83 } |
|
84 } |
|
85 } |
|
86 } |