/** @return ErrorHandler */ public static function getHandler($callback, $data = null, $register = true) { if (self::$_poolLength) { $h = array_pop(self::$_pool); self::$_poolLength--; } else { $h = new ErrorHandler(); } $h->_callback = $callback; $h->data = $data; if ($register) { $h->register(); } return $h; }
public function useExistingConnection($connection) { $this->_connection = $connection; $this->_errorHandler = ErrorHandler::getHandler(array($this, 'onError'), null, false); }
protected function _destroy() { $this->_errorHandler->destroy(); $this->_errorHandler = null; }