Whenever I need to use the intelligence of Netbeans to show properties/methods, I explicitly declare a new object and then re-reference it. Something like..
$moo = new Cow();
$moo = Cow::getById(1);
$hasMilk = $moo->hasMilk();
Is there a way I can avoid this by type-casting the variable when getting it? Or atleast a hack to fool Netbeans?
Thanks!
PS: the main reason of solving this is something if I forget to comment line 1, and when obj is not found, it works with a fresh object! :(
$moo = Cow::getById(1); /* @var $moo Cow */
this will tell netbeans that $moo is an object of type Cow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With