PDA

View Full Version : Can the datamanagers be used to retrieve info too?


amykhar
07-08-2005, 05:26 PM
Or are they just for saving.

For example, could I initialize a forum data manager, set the forumid to the forum I am interested in, and then fetch the forum description using the fetch_field function?

Amy

Dream
07-08-2005, 05:37 PM
/me votes for someone to make a datamanager how-to

amykhar
07-08-2005, 06:03 PM
* Dream votes for someone to make a datamanager how-to
Nah, just for the code to have better documentation. ;)

I tried doing what I posted in the above example. It doesn't seem to work, but I might be missing something.

merk
07-09-2005, 10:01 AM
Im not sure how much help this will be, but im able to do:

$userinfo = fetch_userinfo($userid);

$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
$userdata->set_userfields($userfields);
$userdata->save();

amykhar
07-09-2005, 01:06 PM
And, then once the fields are resaved, they are available for view, huh? I ended up just writing to my own method to do what I wanted. It's a lot easier :)

merk
07-10-2005, 01:44 AM
Well, Im not totally sure, but the main reason i thought the code could help was because of the set_existing() method.

Im not sure if you can retrieve values either, but it could have been a starting point ;)