/** * Check whether the user can have the badge * * @param Users $user * @return boolean */ public function canHave(Users $user) { return $user->countPosts('acceptedAnswer = "Y"') >= 1; }