The XML-RPC Blogger API and Movable Type API??™s are a bit more fiddly as they have
actually been deprecated despite still being used in many current web and desktop applications.
Having set up an example interface we can then use it in our concrete classes where it will ensure that
those classes will adhere to the requirements of the original API.
Creating the concrete classes
Since our original shot of Ecto in figure 11.5 showed us editing an article on Places we??™ll continue that theme
and use the MetaWeblog editPost() method to demonstrate both the use of our interface and how methods need
to be set up so Zend_XmlRpc_Server can use them.
Listing 11.6 shows a stripped down version of the Metaweblog class which resides in our models/
directory. The final version would, of course, have to include all the methods in the interface it implements,
but for the sake of space they have not been included here.
Listing 11.6 Our MetaWeblog model implementing the interface from listing 11.4
include_once 'ArticleTable.php';
include_once 'ServiceAuth.php';
class Metaweblog implements Places_Service_Metaweblog_Interface A
{
protected $_auth;
protected $_articleTable;
public function __construct()
{
$this->_auth = new ServiceAuth; B
$this->_articleTable = new ArticleTable();
// Full version would have further code here.
Pages:
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322