Services_Blogging
[ class tree: Services_Blogging ] [ index: Services_Blogging ] [ all elements ]

Class: Services_Blogging_Driver_MetaWeblog

Source Location: /Services_Blogging-0.2.4/Services/Blogging/Driver/MetaWeblog.php

Class Overview

Services_Blogging_Driver
   |
   --Services_Blogging_ExtendedDriver
      |
      --Services_Blogging_Driver_MetaWeblog

metaWeblog API implementation.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: Services_Blogging_ExtendedDriver

Services_Blogging_ExtendedDriver::getPost()
The getPost method is intended to retrive a given post as an object of the Services_Blogging_Post class; given the unique post id which is passed as a parameter to the function.
Services_Blogging_ExtendedDriver::getRecentPosts()
Returns an array of recent posts as Services_Blogging_Post objects
Services_Blogging_ExtendedDriver::getRecentPostTitles()
The getRecentPostTitles method is intended to retrieve the given number of posts titles from a blog.

Class: Services_Blogging_Driver

Services_Blogging_Driver::createNewPost()
Creates a new post object and returns that.
Services_Blogging_Driver::deletePost()
Delete a given post
Services_Blogging_Driver::getSupportedPostProperties()
Returns an array of strings thay define the properties that a post to this blog may have.
Services_Blogging_Driver::getSupportedPostTypes()
Returns an array of supported post types. Pass one of them to createNewPost() to instantiate such a post object.
Services_Blogging_Driver::isPostPropertySupported()
Checks if the given property name/id is supported for this driver.
Services_Blogging_Driver::savePost()
Save a new post into the blog.

Class Details

[line 34]
metaWeblog API implementation.

http://www.xmlrpc.com/metaWeblogApi http://www.movabletype.org/mt-static/docs/mtmanual_programmatic.html



[ Top ]


Class Variables

$arSupportedPostProperties = array(
        Services_Blogging_Post::TITLE,
        Services_Blogging_Post::CONTENT,
        Services_Blogging_Post::DATE,
        Services_Blogging_Post::URL,
        Services_Blogging_Post::CATEGORIES,
    )

[line 43]

  • Access: protected

Type:   mixed


[ Top ]

$userdata = array()

[line 41]

Internal list with user data.
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 63]

Services_Blogging_Driver_MetaWeblog __construct( string $user, string $pass, string $server, string $path)

Constructor for the metaWeblog driver class.
  • Throws: Services_Blogging_Exception If authentication fails
  • Access: public

Parameters:

string   $user     The username of the blog account.
string   $pass     The password of the blog account.
string   $server     The URI of the server to connect to.
string   $path     The path to the XML-RPC server script.

[ Top ]

convertPostToStruct   [line 335]

void convertPostToStruct( Services_Blogging_Post $post)

Converts Services_Blogging_Post object to an XML-RPC struct that can be sent to the server.
  • Access: protected

Parameters:

Services_Blogging_Post   $post     Post object to convert

[ Top ]

convertStructToPost   [line 297]

Services_Blogging_Post convertStructToPost( array $arStruct)

Converts a struct returned by the webservice to a Services_Blogging_Post object
  • Return: Converted post
  • Access: protected

Parameters:

array   $arStruct     Struct to convert

[ Top ]

deletePost   [line 169]

boolean deletePost( mixed $post)

Delete a given post.

The deletePost method in metaWeblog is just an alias to the deletePost blogger method

  • Return: True if deleted, false if not.
  • Access: public

Overrides Services_Blogging_Driver::deletePost() (Delete a given post)

Parameters:

mixed   $post     Services_Blogging_Post object to delete, or post id (integer) to delete

[ Top ]

getPost   [line 141]

Services_Blogging_Post getPost( string $id)

The getPost method is intended to retrive a given post as an object of the Services_Blogging_Post class; given the unique post id which is passed as a parameter to the function.
  • Return: The elements of the post returned as an object of the Services_Blogging_Post class.
  • Throws: Services_Blogging_Exception If the post does not exist
  • Access: public

Overrides Services_Blogging_ExtendedDriver::getPost() (The getPost method is intended to retrive a given post as an object of the Services_Blogging_Post class; given the unique post id which is passed as a parameter to the function.)

Parameters:

string   $id     The PostID of the post to be retrieved. (As returned by newPost() defined in Services_Blogging_driver).

[ Top ]

getRecentPosts   [line 201]

Array getRecentPosts( [int $number = 15])

Returns an array of recent posts as Services_Blogging_Post objects
  • Return: An array of objects of the Services_Blogging_Post class that correspond to the number of posts requested.
  • Access: public

Overrides Services_Blogging_ExtendedDriver::getRecentPosts() (Returns an array of recent posts as Services_Blogging_Post objects)

Parameters:

int   $number     The number of posts to be retrieved. Defaults to 15

[ Top ]

getRecentPostTitles   [line 241]

Array getRecentPostTitles( [int $number = 15])

The getRecentPostTitles method is intended to retrieve the given number of posts titles from a blog.

The posts themselves can be retrieved with getPost() or getRecentPosts().

There is no direct getRecentPostTitles method in metaWeblog. So we internally call getRecentPosts() and strip out ids and titles of the post. So this method is slow here, because all post data needs to be transmitted.

  • Return: An array of int => strings representing the post ids (key) and their title (value).
  • Access: public

Overrides Services_Blogging_ExtendedDriver::getRecentPostTitles() (The getRecentPostTitles method is intended to retrieve the given number of posts titles from a blog.)

Parameters:

int   $number     The number of posts to be retrieved.

[ Top ]

getSupportedPostProperties   [line 264]

array getSupportedPostProperties( [string $strPostType = 'post'])

Returns an array of strings thay define the properties that a post to this blog may have.

Overrides Services_Blogging_Driver::getSupportedPostProperties() (Returns an array of strings thay define the properties that a post to this blog may have.)

Parameters:

string   $strPostType     Type of post to create.

[ Top ]

isPostPropertySupported   [line 282]

boolean isPostPropertySupported( string $strProperty, [string $strPostType = 'post'])

Checks if the given property name/id is supported for this driver.

Overrides Services_Blogging_Driver::isPostPropertySupported() (Checks if the given property name/id is supported for this driver.)

Parameters:

string   $strProperty     Property name/id to check
string   $strPostType     Type of post to create.

[ Top ]

savePost   [line 93]

void savePost( Services_Blogging_Post $post)

Save a new post into the blog.
  • Throws: Services_Blogging_Exception If an error occured
  • Access: public

Overrides Services_Blogging_Driver::savePost() (Save a new post into the blog.)

Parameters:

Services_Blogging_Post   $post     Post object to put online

[ Top ]


Documentation generated on Sat, 10 Dec 2011 15:30:29 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.