editPost the requirement is that it
returns a boolean value and consumes the following parameters:
metaWeblog.editPost (postid, username, password, struct, publish)
How our application actually carries out the processing of this request is dependant on the application
itself, but the fact that it must implement the required methods clearly indicates an appropriate use for object
interfaces. According to the PHP manual ???object interfaces allow you to create code which specifies which
methods a class must implement, without having to define how these methods are handled???. Listing 11.5
shows one of our interfaces establishing all the methods of the Metaweblog API.
Listing 11.5 Our interface for the MetaWeblog API
interface Places_Service_Metaweblog_Interface
{
public function newPost($blogid, $username, $password, $content, $publish);
public function editPost($postid, $username, $password, $content, $publish);
public function getPost($postid, $username, $password);
public function newMediaObject ($blogid, $username, $password, $struct);
public function getCategories($blogid, $username, $password);
public function getRecentPosts($blogid, $username, $password, $numposts);
}
We should note that this interface was quite straightforward to set up as it??™s clearly detailed in the
MetaWeblog spec.
Pages:
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321