Keywords.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 Ebay
  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: Keywords.php 22824 2010-08-09 18:59:54Z renanbr $
  21. */
  22. /**
  23. * @see Zend_Service_Ebay_Finding_Response_Abstract
  24. */
  25. require_once 'Zend/Service/Ebay/Finding/Response/Abstract.php';
  26. /**
  27. * @see Zend_Service_Ebay_Finding
  28. */
  29. require_once 'Zend/Service/Ebay/Finding.php';
  30. /**
  31. * @category Zend
  32. * @package Zend_Service
  33. * @subpackage Ebay
  34. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @license http://framework.zend.com/license/new-bsd New BSD License
  36. * @uses Zend_Service_Ebay_Finding_Response_Abstract
  37. */
  38. class Zend_Service_Ebay_Finding_Response_Keywords extends Zend_Service_Ebay_Finding_Response_Abstract
  39. {
  40. /**
  41. * Contains a spell-checked version of the submitted keywords. If no
  42. * recommended spelling can be identified for the submitted keywords, the
  43. * response contains a warning to that effect and an empty keywords field
  44. * is returned.
  45. *
  46. * @var string
  47. */
  48. public $keywords;
  49. /**
  50. * @return void
  51. */
  52. protected function _init()
  53. {
  54. parent::_init();
  55. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  56. $this->keywords = $this->_query(".//$ns:keywords[1]", 'string');
  57. }
  58. /**
  59. * @param Zend_Service_Ebay_Finding $proxy
  60. * @param Zend_Config|array $options
  61. * @return Zend_Service_Ebay_Finding_Response_Items
  62. */
  63. public function findItems(Zend_Service_Ebay_Finding $proxy, $options = null)
  64. {
  65. // prepare options
  66. $options = Zend_Service_Ebay_Abstract::optionsToArray($options);
  67. $options = $options + $this->_options;
  68. // find items
  69. return $proxy->findItemsByKeywords($this->keywords, $options);
  70. }
  71. }