Google_PostsServiceResource

The "posts" collection of methods.

Defined (1)

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

/src/contrib/Google_BloggerService.php  
  1. class Google_PostsServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Delete a post by id. (posts.delete) 
  5. * @param string $blogId The Id of the Blog. 
  6. * @param string $postId The ID of the Post. 
  7. * @param array $optParams Optional parameters. 
  8. */ 
  9. public function delete($blogId, $postId, $optParams = array()) { 
  10. $params = array('blogId' => $blogId, 'postId' => $postId); 
  11. $params = array_merge($params, $optParams); 
  12. $data = $this->__call('delete', array($params)); 
  13. return $data; 
  14. /** 
  15. * Get a post by id. (posts.get) 
  16. * @param string $blogId ID of the blog to fetch the post from. 
  17. * @param string $postId The ID of the post 
  18. * @param array $optParams Optional parameters. 
  19. * @opt_param string maxComments Maximum number of comments to pull back on a post. 
  20. * @return Google_Post 
  21. */ 
  22. public function get($blogId, $postId, $optParams = array()) { 
  23. $params = array('blogId' => $blogId, 'postId' => $postId); 
  24. $params = array_merge($params, $optParams); 
  25. $data = $this->__call('get', array($params)); 
  26. if ($this->useObjects()) { 
  27. return new Google_Post($data); 
  28. } else { 
  29. return $data; 
  30. /** 
  31. * Retrieve a Post by Path. (posts.getByPath) 
  32. * @param string $blogId ID of the blog to fetch the post from. 
  33. * @param string $path Path of the Post to retrieve. 
  34. * @param array $optParams Optional parameters. 
  35. * @opt_param string maxComments Maximum number of comments to pull back on a post. 
  36. * @return Google_Post 
  37. */ 
  38. public function getByPath($blogId, $path, $optParams = array()) { 
  39. $params = array('blogId' => $blogId, 'path' => $path); 
  40. $params = array_merge($params, $optParams); 
  41. $data = $this->__call('getByPath', array($params)); 
  42. if ($this->useObjects()) { 
  43. return new Google_Post($data); 
  44. } else { 
  45. return $data; 
  46. /** 
  47. * Add a post. (posts.insert) 
  48. * @param string $blogId ID of the blog to add the post to. 
  49. * @param Google_Post $postBody 
  50. * @param array $optParams Optional parameters. 
  51. * @return Google_Post 
  52. */ 
  53. public function insert($blogId, Google_Post $postBody, $optParams = array()) { 
  54. $params = array('blogId' => $blogId, 'postBody' => $postBody); 
  55. $params = array_merge($params, $optParams); 
  56. $data = $this->__call('insert', array($params)); 
  57. if ($this->useObjects()) { 
  58. return new Google_Post($data); 
  59. } else { 
  60. return $data; 
  61. /** 
  62. * Retrieves a list of posts, possibly filtered. (posts.list) 
  63. * @param string $blogId ID of the blog to fetch posts from. 
  64. * @param array $optParams Optional parameters. 
  65. * @opt_param string endDate Latest post date to fetch, a date-time with RFC 3339 formatting. 
  66. * @opt_param bool fetchBodies Whether the body content of posts is included. 
  67. * @opt_param string labels Comma-separated list of labels to search for. 
  68. * @opt_param string maxResults Maximum number of posts to fetch. 
  69. * @opt_param string pageToken Continuation token if the request is paged. 
  70. * @opt_param string startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. 
  71. * @return Google_PostList 
  72. */ 
  73. public function listPosts($blogId, $optParams = array()) { 
  74. $params = array('blogId' => $blogId); 
  75. $params = array_merge($params, $optParams); 
  76. $data = $this->__call('list', array($params)); 
  77. if ($this->useObjects()) { 
  78. return new Google_PostList($data); 
  79. } else { 
  80. return $data; 
  81. /** 
  82. * Update a post. This method supports patch semantics. (posts.patch) 
  83. * @param string $blogId The ID of the Blog. 
  84. * @param string $postId The ID of the Post. 
  85. * @param Google_Post $postBody 
  86. * @param array $optParams Optional parameters. 
  87. * @return Google_Post 
  88. */ 
  89. public function patch($blogId, $postId, Google_Post $postBody, $optParams = array()) { 
  90. $params = array('blogId' => $blogId, 'postId' => $postId, 'postBody' => $postBody); 
  91. $params = array_merge($params, $optParams); 
  92. $data = $this->__call('patch', array($params)); 
  93. if ($this->useObjects()) { 
  94. return new Google_Post($data); 
  95. } else { 
  96. return $data; 
  97. /** 
  98. * Search for a post. (posts.search) 
  99. * @param string $blogId ID of the blog to fetch the post from. 
  100. * @param string $q Query terms to search this blog for matching posts. 
  101. * @param array $optParams Optional parameters. 
  102. * @return Google_PostList 
  103. */ 
  104. public function search($blogId, $q, $optParams = array()) { 
  105. $params = array('blogId' => $blogId, 'q' => $q); 
  106. $params = array_merge($params, $optParams); 
  107. $data = $this->__call('search', array($params)); 
  108. if ($this->useObjects()) { 
  109. return new Google_PostList($data); 
  110. } else { 
  111. return $data; 
  112. /** 
  113. * Update a post. (posts.update) 
  114. * @param string $blogId The ID of the Blog. 
  115. * @param string $postId The ID of the Post. 
  116. * @param Google_Post $postBody 
  117. * @param array $optParams Optional parameters. 
  118. * @return Google_Post 
  119. */ 
  120. public function update($blogId, $postId, Google_Post $postBody, $optParams = array()) { 
  121. $params = array('blogId' => $blogId, 'postId' => $postId, 'postBody' => $postBody); 
  122. $params = array_merge($params, $optParams); 
  123. $data = $this->__call('update', array($params)); 
  124. if ($this->useObjects()) { 
  125. return new Google_Post($data); 
  126. } else { 
  127. return $data;