I couldn't find about my issue on google and SO. Hope, i can explain you.
You'll understand when looked following function:
function get_page($identity)
{
if($identity is id)
$page = $this->get_page_from_model_by_id($identity);
elseif($identity is alias)
$page = $this->get_page_from_model_by_alias($identity);
}
My used function:
get_page(5); // with id
or
get_page('about-us'); // with alias
or
get_page(5, 'about-us'); // with both
I want to send parameter to function id or alias. It should be only one identifier.
I dont want like function get_page($id, $alias)
How can i get and know parameter type with only one variable. Is there any function or it possible?
idandaliasclasses, and the param passed is object of that class?func_get_args()return the given arguments as an arrayif($identity instanceof id)?get_page_from_model_by_idandget_page_from_model_by_aliasdirectly?