mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-15 23:38:01 +02:00
allow set default attribute in the getAttribute
This commit is contained in:
parent
df5e03a827
commit
d11cd83089
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue