This problem is related to not instantiating the global $_CB_framework where you need it.
For instance, if you have a function() and inside this function you need access to myId() then you need to call the global at the top of the function as such:
Code:
public function getId(){
global $_CB_framework;
$myId = $_CB_framework->myId();
return $myId;
}