Google_ProductsServiceResource

The "products" collection of methods.

Defined (1)

The class is defined in the following location(s).

/src/contrib/Google_ShoppingService.php  
  1. class Google_ProductsServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Returns a single product (products.get) 
  5. * @param string $source Query source 
  6. * @param string $accountId Merchant center account id 
  7. * @param string $productIdType Type of productId 
  8. * @param string $productId Id of product 
  9. * @param array $optParams Optional parameters. 
  10. * @opt_param string attributeFilter Comma separated list of attributes to return 
  11. * @opt_param bool categories.enabled Whether to return category information 
  12. * @opt_param string categories.include Category specification 
  13. * @opt_param bool categories.useGcsConfig This parameter is currently ignored 
  14. * @opt_param string location Location used to determine tax and shipping 
  15. * @opt_param bool recommendations.enabled Whether to return recommendation information 
  16. * @opt_param string recommendations.include Recommendation specification 
  17. * @opt_param bool recommendations.useGcsConfig This parameter is currently ignored 
  18. * @opt_param string taxonomy Merchant taxonomy 
  19. * @opt_param string thumbnails Thumbnail specification 
  20. * @return Google_Product 
  21. */ 
  22. public function get($source, $accountId, $productIdType, $productId, $optParams = array()) { 
  23. $params = array('source' => $source, 'accountId' => $accountId, 'productIdType' => $productIdType, 'productId' => $productId); 
  24. $params = array_merge($params, $optParams); 
  25. $data = $this->__call('get', array($params)); 
  26. if ($this->useObjects()) { 
  27. return new Google_Product($data); 
  28. } else { 
  29. return $data; 
  30. /** 
  31. * Returns a list of products and content modules (products.list) 
  32. * @param string $source Query source 
  33. * @param array $optParams Optional parameters. 
  34. * @opt_param string attributeFilter Comma separated list of attributes to return 
  35. * @opt_param string availability Comma separated list of availabilities (outOfStock, limited, inStock, backOrder, preOrder, onDisplayToOrder) to return 
  36. * @opt_param string boostBy Boosting specification 
  37. * @opt_param bool categories.enabled Whether to return category information 
  38. * @opt_param string categories.include Category specification 
  39. * @opt_param bool categories.useGcsConfig This parameter is currently ignored 
  40. * @opt_param string categoryRecommendations.category Category for which to retrieve recommendations 
  41. * @opt_param bool categoryRecommendations.enabled Whether to return category recommendation information 
  42. * @opt_param string categoryRecommendations.include Category recommendation specification 
  43. * @opt_param bool categoryRecommendations.useGcsConfig This parameter is currently ignored 
  44. * @opt_param string channels Channels specification 
  45. * @opt_param bool clickTracking Whether to add a click tracking parameter to offer URLs 
  46. * @opt_param string country Country restriction (ISO 3166) 
  47. * @opt_param string crowdBy Crowding specification 
  48. * @opt_param string currency Currency restriction (ISO 4217) 
  49. * @opt_param bool extras.enabled Whether to return extra information. 
  50. * @opt_param string extras.info What extra information to return. 
  51. * @opt_param string facets.discover Facets to discover 
  52. * @opt_param bool facets.enabled Whether to return facet information 
  53. * @opt_param string facets.include Facets to include (applies when useGcsConfig == false) 
  54. * @opt_param bool facets.includeEmptyBuckets Return empty facet buckets. 
  55. * @opt_param bool facets.useGcsConfig Whether to return facet information as configured in the GCS account 
  56. * @opt_param string language Language restriction (BCP 47) 
  57. * @opt_param string location Location used to determine tax and shipping 
  58. * @opt_param string maxResults Maximum number of results to return 
  59. * @opt_param int maxVariants Maximum number of variant results to return per result 
  60. * @opt_param bool promotions.enabled Whether to return promotion information 
  61. * @opt_param bool promotions.useGcsConfig Whether to return promotion information as configured in the GCS account 
  62. * @opt_param string q Search query 
  63. * @opt_param string rankBy Ranking specification 
  64. * @opt_param bool redirects.enabled Whether to return redirect information 
  65. * @opt_param bool redirects.useGcsConfig Whether to return redirect information as configured in the GCS account 
  66. * @opt_param bool relatedQueries.enabled Whether to return related queries 
  67. * @opt_param bool relatedQueries.useGcsConfig This parameter is currently ignored 
  68. * @opt_param string restrictBy Restriction specification 
  69. * @opt_param bool safe Whether safe search is enabled. Default: true 
  70. * @opt_param bool spelling.enabled Whether to return spelling suggestions 
  71. * @opt_param bool spelling.useGcsConfig This parameter is currently ignored 
  72. * @opt_param string startIndex Index (1-based) of first product to return 
  73. * @opt_param string taxonomy Taxonomy name 
  74. * @opt_param string thumbnails Image thumbnails specification 
  75. * @opt_param string useCase One of CommerceSearchUseCase, ShoppingApiUseCase 
  76. * @return Google_Products 
  77. */ 
  78. public function listProducts($source, $optParams = array()) { 
  79. $params = array('source' => $source); 
  80. $params = array_merge($params, $optParams); 
  81. $data = $this->__call('list', array($params)); 
  82. if ($this->useObjects()) { 
  83. return new Google_Products($data); 
  84. } else { 
  85. return $data;