/** * sets the logging function * @param string|array $func name of logging function|a pair of class and static method to use for logging (array('class','method')) * @access public * @static */ public static function setLogger($func) { if (is_array($func)) { if (!method_exists($func[0], $func[1])) { throw new NewDaoException("Function {$func[0]}::{$func[1]} does not exists"); } } elseif (is_string($func)) { if (!function_exists($func)) { throw new NewDaoException("Function {$func} does not exists"); } } else { throw new NewDaoException('Spplied Paramater is not a function'); } self::$_logger = $func; }