From d11cd830893db6b5963f230fdfb224af7c0f7f51 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Mon, 19 Aug 2024 15:01:25 +0700 Subject: [PATCH] allow set default attribute in the getAttribute --- system/autoload/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/autoload/User.php b/system/autoload/User.php index e9358620..e8e6e65f 100644 --- a/system/autoload/User.php +++ b/system/autoload/User.php @@ -123,7 +123,7 @@ class User return 0; } - public static function getAttribute($name, $id = 0) + public static function getAttribute($name, $id = 0, $default = '') { if (!$id) { $id = User::getID(); @@ -135,7 +135,7 @@ class User if ($f) { return $f['field_value']; } - return ''; + return $default; } public static function getAttributes($endWith, $id = 0)