SnippetQuery.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. * Zend_Gdata_Query
  23. */
  24. require_once('Zend/Gdata/Query.php');
  25. /**
  26. * Zend_Gdata_Gbase_Query
  27. */
  28. require_once('Zend/Gdata/Gbase/Query.php');
  29. /**
  30. * Assists in constructing queries for Google Base Snippets 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_SnippetQuery extends Zend_Gdata_Gbase_Query
  41. {
  42. /**
  43. * Path to the snippets feeds on the Google Base server.
  44. */
  45. const BASE_SNIPPET_FEED_URI = 'http://www.google.com/base/feeds/snippets';
  46. /**
  47. * The default URI for POST methods
  48. *
  49. * @var string
  50. */
  51. protected $_defaultFeedUri = self::BASE_SNIPPET_FEED_URI;
  52. /**
  53. * Returns the query URL generated by this query instance.
  54. *
  55. * @return string The query URL for this instance.
  56. */
  57. public function getQueryUrl()
  58. {
  59. $uri = $this->_defaultFeedUri;
  60. if ($this->getCategory() !== null) {
  61. $uri .= '/-/' . $this->getCategory();
  62. }
  63. $uri .= $this->getQueryString();
  64. return $uri;
  65. }
  66. }