From fc4d32949b401d725a455a387b0c017dc16281f9 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 26 Nov 2006 00:34:49 +0000 Subject: [PATCH] - Added GetType() to allow fetching of an object by type - Make _errorHandler() public --- Register.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Register.php b/Register.php index 74f6039..2c6382b 100644 --- a/Register.php +++ b/Register.php @@ -308,6 +308,25 @@ class BSRegister return self::Instance()->registry["$key"]; } + // ################################################################### + /** + * Returns the first object of a specified class type + * + * @param string Class name + * + * @return object Object in the registry of that type + */ + public function GetType($class) + { + foreach (self::Instance()->registry AS $key => $object) + { + if ($object instanceof $class) + { + return $object; + } + } + } + // ################################################################### /** * Returns the entire registry stack @@ -418,7 +437,7 @@ class BSRegister * @param string The line number of the error * @param string The active symbol table at which point the error occurred */ - private function _errorHandler($errno, $errstr, $errfile, $errline, $errcontext) + public function _errorHandler($errno, $errstr, $errfile, $errline, $errcontext) { $level = ini_get('error_reporting'); -- 2.43.5