I have a function that is called like this:
foo($object->ID);
and in the function I need to somehow select $object if $object->ID is passed as a variable.
function foo($id = NULL){
if($id != NULL) ... // here I want to get $object
else ...
}
How can I do this?