Google_PostsServiceResource
The "posts" collection of methods.
Defined (1)
The class is defined in the following location(s).
- /src/contrib/Google_BloggerService.php
- class Google_PostsServiceResource extends Google_ServiceResource {
- /**
- * Delete a post by id. (posts.delete)
- *
- * @param string $blogId The Id of the Blog.
- * @param string $postId The ID of the Post.
- * @param array $optParams Optional parameters.
- */
- public function delete($blogId, $postId, $optParams = array()) {
- $params = array('blogId' => $blogId, 'postId' => $postId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- /**
- * Get a post by id. (posts.get)
- *
- * @param string $blogId ID of the blog to fetch the post from.
- * @param string $postId The ID of the post
- * @param array $optParams Optional parameters.
- *
- * @opt_param string maxComments Maximum number of comments to pull back on a post.
- * @return Google_Post
- */
- public function get($blogId, $postId, $optParams = array()) {
- $params = array('blogId' => $blogId, 'postId' => $postId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Google_Post($data);
- } else {
- return $data;
- }
- }
- /**
- * Retrieve a Post by Path. (posts.getByPath)
- *
- * @param string $blogId ID of the blog to fetch the post from.
- * @param string $path Path of the Post to retrieve.
- * @param array $optParams Optional parameters.
- *
- * @opt_param string maxComments Maximum number of comments to pull back on a post.
- * @return Google_Post
- */
- public function getByPath($blogId, $path, $optParams = array()) {
- $params = array('blogId' => $blogId, 'path' => $path);
- $params = array_merge($params, $optParams);
- $data = $this->__call('getByPath', array($params));
- if ($this->useObjects()) {
- return new Google_Post($data);
- } else {
- return $data;
- }
- }
- /**
- * Add a post. (posts.insert)
- *
- * @param string $blogId ID of the blog to add the post to.
- * @param Google_Post $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Post
- */
- public function insert($blogId, Google_Post $postBody, $optParams = array()) {
- $params = array('blogId' => $blogId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Google_Post($data);
- } else {
- return $data;
- }
- }
- /**
- * Retrieves a list of posts, possibly filtered. (posts.list)
- *
- * @param string $blogId ID of the blog to fetch posts from.
- * @param array $optParams Optional parameters.
- *
- * @opt_param string endDate Latest post date to fetch, a date-time with RFC 3339 formatting.
- * @opt_param bool fetchBodies Whether the body content of posts is included.
- * @opt_param string labels Comma-separated list of labels to search for.
- * @opt_param string maxResults Maximum number of posts to fetch.
- * @opt_param string pageToken Continuation token if the request is paged.
- * @opt_param string startDate Earliest post date to fetch, a date-time with RFC 3339 formatting.
- * @return Google_PostList
- */
- public function listPosts($blogId, $optParams = array()) {
- $params = array('blogId' => $blogId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new Google_PostList($data);
- } else {
- return $data;
- }
- }
- /**
- * Update a post. This method supports patch semantics. (posts.patch)
- *
- * @param string $blogId The ID of the Blog.
- * @param string $postId The ID of the Post.
- * @param Google_Post $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Post
- */
- public function patch($blogId, $postId, Google_Post $postBody, $optParams = array()) {
- $params = array('blogId' => $blogId, 'postId' => $postId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('patch', array($params));
- if ($this->useObjects()) {
- return new Google_Post($data);
- } else {
- return $data;
- }
- }
- /**
- * Search for a post. (posts.search)
- *
- * @param string $blogId ID of the blog to fetch the post from.
- * @param string $q Query terms to search this blog for matching posts.
- * @param array $optParams Optional parameters.
- * @return Google_PostList
- */
- public function search($blogId, $q, $optParams = array()) {
- $params = array('blogId' => $blogId, 'q' => $q);
- $params = array_merge($params, $optParams);
- $data = $this->__call('search', array($params));
- if ($this->useObjects()) {
- return new Google_PostList($data);
- } else {
- return $data;
- }
- }
- /**
- * Update a post. (posts.update)
- *
- * @param string $blogId The ID of the Blog.
- * @param string $postId The ID of the Post.
- * @param Google_Post $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Post
- */
- public function update($blogId, $postId, Google_Post $postBody, $optParams = array()) {
- $params = array('blogId' => $blogId, 'postId' => $postId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('update', array($params));
- if ($this->useObjects()) {
- return new Google_Post($data);
- } else {
- return $data;
- }
- }
- }