Error on fetch()
Content
Hi
I have the following:
$sup = RNCPHP\Contact::fetch((int)$supervisor);
This does an error. I have to do the following to workaround:
try {$sup = RNCPHP\Contact::fetch((int)$supervisor);}catch ( \Exception $err ){$sup = null;}
Why can I not just do something like the following instead:
if (empty($sup)) {$sup = null;}
I can do it when I'm issuing this command:
$co = RNCPHP\WMP\the_main::first("type=2634 AND Contact=".$uid);
Any advice?
Tagged:
0