2
0

ItemQuery.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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_Gdata
  17. * @subpackage Gbase
  18. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * @see Zend_Gdata_Query
  23. */
  24. require_once('Zend/Gdata/Query.php');
  25. /**
  26. * @see Zend_Gdata_Gbase_Query
  27. */
  28. require_once('Zend/Gdata/Gbase/Query.php');
  29. /**
  30. * Assists in constructing queries for Google Base Customer Items Feed
  31. *
  32. * @link http://code.google.com/apis/base/
  33. *
  34. * @category Zend
  35. * @package Zend_Gdata
  36. * @subpackage Gbase
  37. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  38. * @license http://framework.zend.com/license/new-bsd New BSD License
  39. */
  40. class Zend_Gdata_Gbase_ItemQuery extends Zend_Gdata_Gbase_Query
  41. {
  42. /**
  43. * Path to the customer items feeds on the Google Base server.
  44. */
  45. const GBASE_ITEM_FEED_URI = 'http://www.google.com/base/feeds/items';
  46. /**
  47. * The default URI for POST methods
  48. *
  49. * @var string
  50. */
  51. protected $_defaultFeedUri = self::GBASE_ITEM_FEED_URI;
  52. /**
  53. * The id of an item
  54. *
  55. * @var string
  56. */
  57. protected $_id = null;
  58. /**
  59. * @param string $value
  60. * @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface
  61. */
  62. public function setId($value)
  63. {
  64. $this->_id = $value;
  65. return $this;
  66. }
  67. /*
  68. * @return string id
  69. */
  70. public function getId()
  71. {
  72. return $this->_id;
  73. }
  74. /**
  75. * Returns the query URL generated by this query instance.
  76. *
  77. * @return string The query URL for this instance.
  78. */
  79. public function getQueryUrl()
  80. {
  81. $uri = $this->_defaultFeedUri;
  82. if ($this->getId() !== null) {
  83. $uri .= '/' . $this->getId();
  84. } else {
  85. $uri .= $this->getQueryString();
  86. }
  87. return $uri;
  88. }
  89. }