Container.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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: Container.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-2015 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_Histogram_Container extends Zend_Service_Ebay_Finding_Abstract
  35. {
  36. /**
  37. * A characteristic of an item in a domain.
  38. *
  39. * For example, "Optical Zoom", "Brand", and "Megapixels" could be aspects
  40. * of the Digital Cameras domain. Aspects are well-known, standardized
  41. * characteristics of a domain, and they vary from domain to domain (the
  42. * aspects of "Men's Shoes" are different from those of "Digital Cameras").
  43. * A search request on the eBay site will often display aspects and their
  44. * respective aspect values on the left-had side of a query response.
  45. *
  46. * Aspects are extracted from item listing properties (such as item titles
  47. * and subtitles), and represent the characteristics of active items. Values
  48. * returned in the Aspect container can be used as inputs to the
  49. * aspectFilter fields in a query to distill the items returned by the
  50. * query. eBay generates aspects dynamically from the items currently
  51. * listed; aspects provide a view into what is currently available on eBay.
  52. * Because of this, aspect values returned one day cannot be guaranteed to
  53. * be valid the next day.
  54. *
  55. * @var Zend_Service_Ebay_Finding_Aspect_Set
  56. */
  57. public $aspect;
  58. /**
  59. * A buy-side group of items, for example "Shoes.".
  60. *
  61. * Domains are extracted from item listing properties, such as the title,
  62. * descriptions, and so on.
  63. *
  64. * @var string
  65. */
  66. public $domainDisplayName;
  67. /**
  68. * A buy-side group of items that share aspects, but not necessarily an eBay
  69. * category.
  70. *
  71. * For example "Women's Dresses" or "Digital Cameras" could be domains. You
  72. * can use a domainName to label a set of aspects that you display.
  73. *
  74. * @var string
  75. */
  76. public $domainName;
  77. /**
  78. * @return void
  79. */
  80. protected function _init()
  81. {
  82. parent::_init();
  83. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  84. $this->domainDisplayName = $this->_query(".//$ns:domainDisplayName[1]", 'string');
  85. $this->domainName = $this->_query(".//$ns:domainName[1]", 'string');
  86. $this->_attributes['aspect'] = array(
  87. 'name' => $this->_query(".//$ns:aspect/@name", 'string', true)
  88. );
  89. $nodes = $this->_xPath->query(".//$ns:aspect", $this->_dom);
  90. if ($nodes->length > 0) {
  91. /**
  92. * @see Zend_Service_Ebay_Finding_Aspect_Set
  93. */
  94. require_once 'Zend/Service/Ebay/Finding/Aspect/Set.php';
  95. $this->aspect = new Zend_Service_Ebay_Finding_Aspect_Set($nodes);
  96. }
  97. }
  98. }