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:
Ralf Becker 2014-06-24 07:25:35 +00:00
parent 4d5b7540bd
commit af9b8303d6
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ class egw_customfields implements IteratorAggregate
$row['private'] = $row['private'] ? explode(',', $row['private']) : array();
$row['type2'] = $row['type2'] ? explode(',', $row['type2']) : array();
$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;
}, array(), function($row)

View File

@ -592,7 +592,7 @@ class egw_db
* @param string $val boolean value in db-specfic notation
* @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
}