> > And how do I load the contents of a saved midgard > > article (such as the one with this id 1636) into > an > > instance of my inherited class test_article? > > in the constructor, call mgd_get_<whatever>($id)
Duh... I found out not being the first one to think in that way... Tonight I remembered having read something in the past about a MidgardArticle, but then forgot because I didn't really understand what the purpose was. However, I found back some stuff that Torben Nehmer wrote: http://www.nathan-syntronics.de/midgard/oop/extending.html , with http://www.nathan-syntronics.de/midgard/oop/baseclasses/CArticle.html as an example. It turns out that in order to load the data, it has to be manually copied from a dummy result of mgd_getXXXXX. But then again, (maybe this is already far off topic for this list), I tried: //Torben's CArticle $test_variable = new Carticle(1636); $test_variable->title = "hoho"; if ($test_variable->update()) {echo " update ok <br>";} else {echo " update not ok for ".mgd_errstr()."<br>";} //the normal stuff $test_variable = mgd_get_article(1636); $test_variable->title = "haha"; if ($test_variable->update()) {echo " update ok <br>";} else {echo " update not ok for ".mgd_errstr()."<br>";} This gave (on a page with the proper authentication): update not ok for MGD_ERR_INVALID_OBJECT update ok So does this mean that you cannot simply use the inherited object functions such as update() (and the rest)? And that you have to override them with your own implementations, using a dummy article you copy first your data to and then perform the update() on? Did you pursue on the effort you started at http://www.nathan-syntronics.de/midgard/oop/extending.html, Torben? Pascal __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
