allow set default attribute in the getAttribute
This commit is contained in:
parent
df5e03a827
commit
d11cd83089
@ -123,7 +123,7 @@ class User
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAttribute($name, $id = 0)
|
public static function getAttribute($name, $id = 0, $default = '')
|
||||||
{
|
{
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
$id = User::getID();
|
$id = User::getID();
|
||||||
@ -135,7 +135,7 @@ class User
|
|||||||
if ($f) {
|
if ($f) {
|
||||||
return $f['field_value'];
|
return $f['field_value'];
|
||||||
}
|
}
|
||||||
return '';
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAttributes($endWith, $id = 0)
|
public static function getAttributes($endWith, $id = 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user