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
13
Views
1
Comments
edited Jun 7, 2022 1:20PM in General Technical Discussions 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!