CustomerReview.php 2.0 KB

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