Reputation: 1820
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! :(
Upvotes: 4
Views: 2185
Reputation: 34107
$moo = Cow::getById(1); /* @var $moo Cow */
this will tell netbeans that $moo is an object of type Cow
Upvotes: 7
Reputation: 62369
Type vdoc
and press tab. In the comment that appears put name of the class.
Upvotes: 1