Zend_Gdata_Books

Service class for interacting with the Books service.

Defined (1)

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

/inc/VideoUploader/includes/Zend/Gdata/Books.php  
  1. class Zend_Gdata_Books extends Zend_Gdata 
  2. const VOLUME_FEED_URI = 'https://books.google.com/books/feeds/volumes'; 
  3. const MY_LIBRARY_FEED_URI = 'https://books.google.com/books/feeds/users/me/collections/library/volumes'; 
  4. const MY_ANNOTATION_FEED_URI = 'https://books.google.com/books/feeds/users/me/volumes'; 
  5. const AUTH_SERVICE_NAME = 'print'; 
  6.  
  7. /** 
  8. * Namespaces used for Zend_Gdata_Books 
  9. * @var array 
  10. */ 
  11. public static $namespaces = array( 
  12. array('gbs', 'http://schemas.google.com/books/2008', 1, 0),  
  13. array('dc', 'http://purl.org/dc/terms', 1, 0) 
  14. ); 
  15.  
  16. /** 
  17. * Create Zend_Gdata_Books object 
  18. * @param Zend_Http_Client $client (optional) The HTTP client to use when 
  19. * when communicating with the Google servers. 
  20. * @param string $applicationId The identity of the app in the form of Company-AppName-Version 
  21. */ 
  22. public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0') 
  23. $this->registerPackage('Zend_Gdata_Books'); 
  24. $this->registerPackage('Zend_Gdata_Books_Extension'); 
  25. parent::__construct($client, $applicationId); 
  26. $this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME); 
  27.  
  28. /** 
  29. * Retrieves a feed of volumes. 
  30. * @param Zend_Gdata_Query|string|null $location (optional) The URL to 
  31. * query or a Zend_Gdata_Query object from which a URL can be 
  32. * determined. 
  33. * @return Zend_Gdata_Books_VolumeFeed The feed of volumes found at the 
  34. * specified URL. 
  35. */ 
  36. public function getVolumeFeed($location = null) 
  37. if ($location == null) { 
  38. $uri = self::VOLUME_FEED_URI; 
  39. } else if ($location instanceof Zend_Gdata_Query) { 
  40. $uri = $location->getQueryUrl(); 
  41. } else { 
  42. $uri = $location; 
  43. return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed'); 
  44.  
  45. /** 
  46. * Retrieves a specific volume entry. 
  47. * @param string|null $volumeId The volumeId of interest. 
  48. * @param Zend_Gdata_Query|string|null $location (optional) The URL to 
  49. * query or a Zend_Gdata_Query object from which a URL can be 
  50. * determined. 
  51. * @return Zend_Gdata_Books_VolumeEntry The feed of volumes found at the 
  52. * specified URL. 
  53. */ 
  54. public function getVolumeEntry($volumeId = null, $location = null) 
  55. if ($volumeId !== null) { 
  56. $uri = self::VOLUME_FEED_URI . "/" . $volumeId; 
  57. } else if ($location instanceof Zend_Gdata_Query) { 
  58. $uri = $location->getQueryUrl(); 
  59. } else { 
  60. $uri = $location; 
  61. return parent::getEntry($uri, 'Zend_Gdata_Books_VolumeEntry'); 
  62.  
  63. /** 
  64. * Retrieves a feed of volumes, by default the User library feed. 
  65. * @param Zend_Gdata_Query|string|null $location (optional) The URL to 
  66. * query. 
  67. * @return Zend_Gdata_Books_VolumeFeed The feed of volumes found at the 
  68. * specified URL. 
  69. */ 
  70. public function getUserLibraryFeed($location = null) 
  71. if ($location == null) { 
  72. $uri = self::MY_LIBRARY_FEED_URI; 
  73. } else { 
  74. $uri = $location; 
  75. return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed'); 
  76.  
  77. /** 
  78. * Retrieves a feed of volumes, by default the User annotation feed 
  79. * @param Zend_Gdata_Query|string|null $location (optional) The URL to 
  80. * query. 
  81. * @return Zend_Gdata_Books_VolumeFeed The feed of volumes found at the 
  82. * specified URL. 
  83. */ 
  84. public function getUserAnnotationFeed($location = null) 
  85. if ($location == null) { 
  86. $uri = self::MY_ANNOTATION_FEED_URI; 
  87. } else { 
  88. $uri = $location; 
  89. return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed'); 
  90.  
  91. /** 
  92. * Insert a Volume / Annotation 
  93. * @param Zend_Gdata_Books_VolumeEntry $entry 
  94. * @param Zend_Gdata_Query|string|null $location (optional) The URL to 
  95. * query 
  96. * @return Zend_Gdata_Books_VolumeEntry The inserted volume entry. 
  97. */ 
  98. public function insertVolume($entry, $location = null) 
  99. if ($location == null) { 
  100. $uri = self::MY_LIBRARY_FEED_URI; 
  101. } else { 
  102. $uri = $location; 
  103. return parent::insertEntry( 
  104. $entry, $uri, 'Zend_Gdata_Books_VolumeEntry'); 
  105.  
  106. /** 
  107. * Delete a Volume 
  108. * @param Zend_Gdata_Books_VolumeEntry $entry 
  109. * @return void 
  110. */ 
  111. public function deleteVolume($entry) 
  112. $entry->delete(); 
  113.