Re: PEAR::raiseError() - suggestion
| From: | Greg Beaver | Date: | Thu, 04 Sep 2003 22:03:54 +0000 |
| Subject: | Re: PEAR::raiseError() - suggestion | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7592@lists.php.net to get a copy of this message | ||
Marcin Rociek wrote:
Imagine scenario: - Foo is a subclass of PEAR - Foo_Error is a subclass of PEAR_Error Then I want PEAR::raiseError() to accept some objects (i.e. some parsed XML), and create proper Foo_Error objects, as Foo_Error's constructor knows these parsed objects, and knows where they hold error codes and error messages:You need to override raiseError() - changes to the core are unnecessary. Simply parse the object passed in if it isn't a PEAR_Error, and pass the necessary parameters to parent::raiseError() regards, Greg