mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-10 15:30:25 +01:00
make egw_db::from_bool() static and use that to work around PHP 5.3 limitation of not making class scope available in closures
This commit is contained in:
parent
4d5b7540bd
commit
af9b8303d6
@ -92,7 +92,7 @@ class egw_customfields implements IteratorAggregate
|
|||||||
$row['private'] = $row['private'] ? explode(',', $row['private']) : array();
|
$row['private'] = $row['private'] ? explode(',', $row['private']) : array();
|
||||||
$row['type2'] = $row['type2'] ? explode(',', $row['type2']) : array();
|
$row['type2'] = $row['type2'] ? explode(',', $row['type2']) : array();
|
||||||
$row['values'] = json_decode($row['values'], true);
|
$row['values'] = json_decode($row['values'], true);
|
||||||
$row['needed'] = self::$db->from_bool($row['needed']);
|
$row['needed'] = egw_db::from_bool($row['needed']);
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
}, array(), function($row)
|
}, array(), function($row)
|
||||||
|
@ -592,7 +592,7 @@ class egw_db
|
|||||||
* @param string $val boolean value in db-specfic notation
|
* @param string $val boolean value in db-specfic notation
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function from_bool($val)
|
public static function from_bool($val)
|
||||||
{
|
{
|
||||||
return $val && $val[0] !== 'f'; // everthing other then 0 or f[alse] is returned as true
|
return $val && $val[0] !== 'f'; // everthing other then 0 or f[alse] is returned as true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user