Quote from: opengeek at Sep 20, 2013, 10:55 AMDid you add your extended user class to extension_packages so the proper user class is instantiated on each request to MODX? Did you make sure you remove the id field and primary key you originally had on the Favorites table?
Yes I added the extendend user class and removed the id field/primary key. I regenerated the schema and it seems to be working properly ($user = $modx->getObject('extUser', 1); is correctly outputting the userdata). However, when I use the following code to add a Favorite, game_id and user_id are inserted as '0' in the db, but $gameid and $userid do have the right values.
$userfav = $this->modx->newObject('Favorites',array(
'game_id' => $gameid,
'user_id' => $userid
));
$userfav->save();
When I use the following code, the game_id is inserted properly, but the user_id still is inserted as '0'.
$game = $this->modx->getObject('Game', $gameid);
$userfav = $this->modx->newObject('Favorites',array(
'game_id' => $gameid,
'user_id' => $userid,
'time' => $now->format('Y-m-d H:i:s'),
));
$game->addMany($userfav);
$game->save();
$userfav->save();