Mnn... it might be because the $adopt is a direct reference to the database but not to the class file. getCompanion() is in two places - try it like this, maybe?
PHP Code:
function items_companion($item, $adopt){
$mysidia = Registry::get("mysidia");
//MY CODE
if ($adopt->companion != "nocompanion") {
$item = new StockItem($adopt->companion);
$item->append(1, $mysidia->user->username);
}
//WITH YOURS
$companion = $item->itemname;
$mysidia->db->update("owned_adoptables", array("companion" => $companion), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "You have given your pet a <b>{$item->itemname}</b>! It will now show up in your pet's profile. ";
//Update item quantity...
$delitem = $item->remove();
return $note;
}