bobmagicii, (edited ) bigger this app gets the more im considering switching to a null object approach. but the only people i've ever known using it were canadian 🤣
"dont check if exists and is an instance. know it is an instance. it just happens this instance has id of 0 and email of null."
a: if($User && $User->IsAdmin())
b: ($User->IsAdmin())
a: if($User) ShowTools();
b: if($User->ID !== 0) ShowTools();
though in my cases really it only saves keystrokes with admin checks and wastes them on user.
Add comment