Re: Best way to approach object construction errors?
| From: | Marco Schuler | Date: | Sat, 20 Sep 2003 13:11:33 +0000 |
| Subject: | Re: Best way to approach object construction errors? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163287@lists.php.net to get a copy of this message | ||
Am Don, 2003-09-18 um 20.36 schrieb Mike Zornek:
> I've created a class called university, it has a constructor which can
> accept an id. If the id is sent during construction the constructor will
> connect to a MySQL db to set all of the objects member variables to the
> MySQl counterparts.
>
> I'd like to include some error notification so if I send it an id and let's
> say that record doesn't exist in the db I get some notification and can
> write a message out to log (or screen). But what is the best way to do this?
> Any recommendations? Tutorials? URLs?
Maybe you'd like to have a look at PEAR error-handling.
http://pear.php.net/manual/en/core.pear.php
--
Cheers!
Marco