We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Error on fetch()

Accepted answer
12
Views
1
Comments
edited Apr 2, 2020 11:39AM in Customer Portal 1 comment

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?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!