Stephan Schmidt
Posts: 238
Nickname: schst
Registered: Sep, 2004
|
Stephan Schmidt is a founding member of PHP Application Tools and a PEAR developer.
|
|
|
|
1c Services_Ebay 0.8.0 released 13
|
Posted: Nov 30, 2004 8:05 PM
|
|
e6e
I just released a new version of my PEAR package Services_Ebay, which is now marked as alpha as the API starts to stabilize.
This version includes some quite interesting new features: Services_Ebay now provides some kind of introspection, as you can get a list of all supported API calls using Services_Ebay::getAvailableCalls(). Furthermore it finally supports a changeable SiteId, that means it's not restricted to ebay.com anymore.
To help you debugging your application and to help me analysing the bug reports it's now also possible to capture the XML data that is sent to and recieved from the eBay webservice.
But the coolest new feature are the custom models, an idea I had in the Toby's and Lukas' powerworkshop. They used Services_Ebay in conjunction with some other PEAR packages, but wanted to store some additional information for the items in a database. To achieve this, they created a new object that stored a reference to a Services_Ebay_Model_Item object and the additional data that they wanted to store in the database. Although this worked, it did not look very nice and can get quite messy.
To achieve the same result, you may now create new model items to replace the ones provided by Services_Ebay. That means you can create classes for users, items, feedback etc. that will automatically created and filled with data by the Services_Ebay package. All you have to do is the following:
<?php;
require_once 'Services/Ebay.php';
// simple model class
// You may implement any additional methods you need
// in your custom models.
class myItem extends Services_Ebay_Model_Item
{
// Dummy method
// This does not really do anything, but you can implement whatever you like
// here...
public function StoreItem()
{
echo "Now you could store the item data in your local database...";
}
}
Services_Ebay::useModelClass('Item', 'myItem');
$session = Services_Ebay::getSession($devId, $appId, $certId);
$session->setToken($token);
$ebay = new Services_Ebay($session);
$item = $ebay->GetItem('4501296414');
$item->StoreItem();
?>
This is totally simple and allows you to add any functionality you need in your application without wrapping methods or duplicating code.
17
Read: 1c Services_Ebay 0.8.0 released 13
|
|