Adding getGuarded() getter.

Is there any particular reason why this one has not been created initially?
Merge pull request #6711 from Claymm/patch-3

[4.2] Added getGuarded()