From 47bfff1bd8d108a7aacef431f85df32f29c5b701 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 8 Jan 2006 03:40:48 +0000 Subject: [PATCH] * New function: User::getBoolOption() that wraps User::getOption, casts its output to bool and returns it * Documentation: Documented User::getBoolOption() and User::getOption() --- includes/User.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/User.php b/includes/User.php index 54f442b8d0..c96d03c9e7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -986,6 +986,10 @@ class User { $this->mRealName = $str; } + /** + * @param string $oname The option to check + * @return string + */ function getOption( $oname ) { $this->loadFromDatabase(); if ( array_key_exists( $oname, $this->mOptions ) ) { @@ -995,6 +999,14 @@ class User { } } + /** + * @param string $oname The option to check + * @return bool False if the option is not selected, true if it is + */ + function getBoolOption( $oname ) { + return (bool)$this->getOption( $oname ); + } + function setOption( $oname, $val ) { $this->loadFromDatabase(); if ( $oname == 'skin' ) { -- 2.20.1