Aspect.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: Aspect.php 22791 2010-08-04 16:11:47Z renanbr $
  21. */
  22. /**
  23. * @see Zend_Service_Ebay_Finding_Abstract
  24. */
  25. require_once 'Zend/Service/Ebay/Finding/Abstract.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Service
  29. * @subpackage Ebay
  30. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. * @uses Zend_Service_Ebay_Finding_Abstract
  33. */
  34. class Zend_Service_Ebay_Finding_Aspect extends Zend_Service_Ebay_Finding_Abstract
  35. {
  36. /**
  37. * Container that returns the name of the respective aspect value and the
  38. * histogram (the number of available items) that share that item
  39. * characteristic.
  40. *
  41. * @var Zend_Service_Ebay_Finding_Aspect_Histogram_Value_Set
  42. */
  43. public $valueHistogram;
  44. /**
  45. * Name of an aspect value.
  46. *
  47. * Use array key to associate a name from this attribute to value set.
  48. *
  49. * For example, "Short Sleeve" could be an aspect value of the Sleeve Style
  50. * aspect in the Women's Dresses domain, or "Athletic" could be an aspect
  51. * value of the Style aspect in the Men's Shoes domain.
  52. *
  53. * @var string[]
  54. */
  55. public $valueHistogram_valueName;
  56. /**
  57. * @return void
  58. */
  59. protected function _init()
  60. {
  61. parent::_init();
  62. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  63. $this->valueHistogram_valueName = $this->_query(".//$ns:valueHistogram/@valueName", 'string', true);
  64. $nodes = $this->_xPath->query(".//$ns:valueHistogram", $this->_dom);
  65. if ($nodes->length > 0) {
  66. /**
  67. * @see Zend_Service_Ebay_Finding_Aspect_Histogram_Value_Set
  68. */
  69. require_once 'Zend/Service/Ebay/Finding/Aspect/Histogram/Value/Set.php';
  70. $this->valueHistogram = new Zend_Service_Ebay_Finding_Aspect_Histogram_Value_Set($nodes);
  71. }
  72. }
  73. }